diff --git a/interfaces/kits/ani/window_runtime/window_stage_ani/ets/@ohos.window.ets b/interfaces/kits/ani/window_runtime/window_stage_ani/ets/@ohos.window.ets index 2b198a334f664f1988e142d2eaa7a58e026e58b8..a02beed8cd0b49d1f28fb760710248fe3adcaca8 100644 --- a/interfaces/kits/ani/window_runtime/window_stage_ani/ets/@ohos.window.ets +++ b/interfaces/kits/ani/window_runtime/window_stage_ani/ets/@ohos.window.ets @@ -1976,7 +1976,7 @@ export class WindowInternal implements Window { private native setTitleAndDockHoverShown(nativeObj: long, isTitleHoverShown: boolean, isDockHoverShown: boolean): void; private native restore(nativeObj: long): void; - private native startMoving(nativeObj: long): void; + private native startMovingNative(nativeObj: long): void; private native startMoveWindowWithCoordinate(nativeObj: long, offsetX: int, offsetY: int): void; private native setWindowTitleButtonVisible(nativeObj: long, visibleParam: WindowTitleButtonVisibleParam): void; private native setDecorButtonStyle(nativeObj: long, decorStyle: DecorButtonStyle): void; @@ -2158,10 +2158,10 @@ export class WindowInternal implements Window { }); } - public startMoving(): Promise { + public startMovingWithNoArgs(): Promise { return new Promise((resolve: (value: undefined) => void, reject: (error: BusinessError) => void ) :void => { taskpool.execute((): void => { - this.startMoving(this.nativeObj); + this.startMovingNative(this.nativeObj); }).then((ret: NullishType) :void => { resolve(undefined); }).catch((err: NullishType) :void => { @@ -2170,7 +2170,7 @@ export class WindowInternal implements Window { }); } - public startMoving(offsetX: int, offsetY: int): Promise { + public startMovingWithOffsetXOffsetY (offsetX: int, offsetY: int): Promise { return new Promise((resolve: (value: undefined) => void, reject: (error: BusinessError) => void ) :void => { taskpool.execute((): void => { this.startMoveWindowWithCoordinate(this.nativeObj, offsetX, offsetY); @@ -2182,6 +2182,8 @@ export class WindowInternal implements Window { }); } + overload startMoving { startMovingWithNoArgs, startMovingWithOffsetXOffsetY }; + public setWindowTitleButtonVisible(isMaximizeButtonVisible: boolean, isMinimizeButtonVisible: boolean, isCloseButtonVisible?: boolean): void { let visibleParam: window.WindowTitleButtonVisibleParam = { @@ -2901,8 +2903,9 @@ export interface Window { setTitleAndDockHoverShown(isTitleHoverShown?: boolean, isDockHoverShown?: boolean): Promise; restore(): Promise; - startMoving(): Promise; - startMoving(offsetX: int, offsetY: int): Promise; + startMovingWithNoArgs(): Promise; + startMovingWithOffsetXOffsetY(offsetX: int, offsetY: int): Promise; + overload startMoving { startMovingWithNoArgs, startMovingWithOffsetXOffsetY }; setWindowTitleButtonVisible(isMaximizeButtonVisible: boolean, isMinimizeButtonVisible: boolean, isCloseButtonVisible?: boolean): void; setDecorButtonStyle(dectorStyle: DecorButtonStyle): void; diff --git a/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window.cpp b/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window.cpp index f25c9bad0d22a7552577c3dccfa7a13d8387037f..8cf73fff9fcc55c598dbf7280db1f3c314a8c52a 100644 --- a/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window.cpp +++ b/interfaces/kits/ani/window_runtime/window_stage_ani/src/ani_window.cpp @@ -2653,7 +2653,7 @@ ani_status OHOS::Rosen::ANI_Window_Constructor(ani_vm *vm, uint32_t *result) reinterpret_cast(SetTitleAndDockHoverShown)}, ani_native_function {"restore", "J:V", reinterpret_cast(Restore)}, - ani_native_function {"startMoving", "J:V", + ani_native_function {"startMovingNative", "J:V", reinterpret_cast(StartMoving)}, ani_native_function {"startMoveWindowWithCoordinate", "JII:V", reinterpret_cast(StartMoveWindowWithCoordinate)},