normalize ndk interface of xcomponent

Signed-off-by: zhangbingce <zhangbingce@huawei.com>
Change-Id: I78e2a65126cbf15464d26784113042b09a69e69e
This commit is contained in:
zhangbingce
2022-02-09 10:04:09 +08:00
parent 8b1b20bfe7
commit c4b5ef1e64
3 changed files with 34 additions and 15 deletions
@@ -33,6 +33,9 @@ int32_t NativeXComponent_GetXComponentId(NativeXComponent* component, char* id,
return component->GetXComponentId(id, size);
}
int32_t OH_NativeXComponent_GetXComponentId(NativeXComponent* component, char* id, uint64_t* size)
__attribute__((weak, alias("NativeXComponent_GetXComponentId")));
int32_t NativeXComponent_GetNativeWindow(NativeXComponent* component, void** window)
{
if ((component == nullptr) || (window == nullptr)) {
@@ -41,6 +44,9 @@ int32_t NativeXComponent_GetNativeWindow(NativeXComponent* component, void** win
return component->GetNativeWindow(window);
}
int32_t OH_NativeXComponent_GetNativeWindow(NativeXComponent* component, void** window)
__attribute__((weak, alias("NativeXComponent_GetNativeWindow")));
int32_t NativeXComponent_GetXComponentSize(
NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height)
{
@@ -50,6 +56,10 @@ int32_t NativeXComponent_GetXComponentSize(
return component->GetXComponentSize(window, width, height);
}
int32_t OH_NativeXComponent_GetXComponentSize(
NativeXComponent* component, const void* window, uint64_t* width, uint64_t* height)
__attribute__((weak, alias("NativeXComponent_GetXComponentSize")));
int32_t NativeXComponent_GetXComponentOffset(NativeXComponent* component, const void* window, double* x, double* y)
{
if ((component == nullptr) || (window == nullptr) || (x == nullptr) || (y == nullptr)) {
@@ -58,6 +68,9 @@ int32_t NativeXComponent_GetXComponentOffset(NativeXComponent* component, const
return component->GetXComponentOffset(window, x, y);
}
int32_t OH_NativeXComponent_GetXComponentOffset(NativeXComponent* component, const void* window, double* x, double* y)
__attribute__((weak, alias("NativeXComponent_GetXComponentOffset")));
int32_t NativeXComponent_GetTouchInfo(NativeXComponent* component, const void* window, TouchInfo* touchInfo)
{
if ((component == nullptr) || (window == nullptr) || (touchInfo == nullptr)) {
@@ -66,6 +79,9 @@ int32_t NativeXComponent_GetTouchInfo(NativeXComponent* component, const void* w
return component->GetTouchInfo(window, touchInfo);
}
int32_t OH_NativeXComponent_GetTouchInfo(NativeXComponent* component, const void* window, TouchInfo* touchInfo)
__attribute__((weak, alias("NativeXComponent_GetTouchInfo")));
int32_t NativeXComponent_RegisterCallback(NativeXComponent* component, NativeXComponentCallback* callback)
{
if ((component == nullptr) || (callback == nullptr)) {
@@ -74,6 +90,9 @@ int32_t NativeXComponent_RegisterCallback(NativeXComponent* component, NativeXCo
return component->RegisterCallback(callback);
}
int32_t OH_NativeXComponent_RegisterCallback(NativeXComponent* component, NativeXComponentCallback* callback)
__attribute__((weak, alias("NativeXComponent_RegisterCallback")));
#ifdef __cplusplus
};
#endif