From 5daccb39c5f69e3a6dd1144a015cdd7e66da58bd Mon Sep 17 00:00:00 2001 From: wanglili12 Date: Mon, 17 Mar 2025 19:40:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?getHostContext=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglili12 --- arkoala-arkts/arkui/src/context.ts | 25 +++++++++++++++++++ .../arkui/src/generated/arkts/context.ts | 23 +++++++++++++++++ .../arkui/src/generated/arkts/index.ts | 3 ++- .../arkui/src/generated/ts/context.ts | 16 ++++++++++++ arkoala-arkts/arkui/src/generated/ts/index.ts | 1 + .../arkui/src/ohos.arkui.UIContext.ts | 7 ++++++ arkoala-arkts/arkui/types/index-full.d.ts | 1 - 7 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 arkoala-arkts/arkui/src/context.ts create mode 100644 arkoala-arkts/arkui/src/generated/arkts/context.ts create mode 100644 arkoala-arkts/arkui/src/generated/ts/context.ts diff --git a/arkoala-arkts/arkui/src/context.ts b/arkoala-arkts/arkui/src/context.ts new file mode 100644 index 000000000..408f02d30 --- /dev/null +++ b/arkoala-arkts/arkui/src/context.ts @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! + +import { Context1 } from "#components" + +export class Context { + constructor() { + //Context1.xxx 原能力获取Context的ani接口 + } +} \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/arkts/context.ts b/arkoala-arkts/arkui/src/generated/arkts/context.ts new file mode 100644 index 000000000..cf426948b --- /dev/null +++ b/arkoala-arkts/arkui/src/generated/arkts/context.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { loadNativeModuleLibrary } from "@koalaui/interop" + +export class Context1 { + static { + loadNativeModuleLibrary("application.Context") + + } +} \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/arkts/index.ts b/arkoala-arkts/arkui/src/generated/arkts/index.ts index 69e843017..ab122c29d 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/index.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/index.ts @@ -1,4 +1,5 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" -export * from "./TestNativeModule" \ No newline at end of file +export * from "./TestNativeModule" +export * from "./context" \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/ts/context.ts b/arkoala-arkts/arkui/src/generated/ts/context.ts new file mode 100644 index 000000000..35f598c04 --- /dev/null +++ b/arkoala-arkts/arkui/src/generated/ts/context.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const Context1: any = undefined diff --git a/arkoala-arkts/arkui/src/generated/ts/index.ts b/arkoala-arkts/arkui/src/generated/ts/index.ts index 4aedac570..38beac31c 100644 --- a/arkoala-arkts/arkui/src/generated/ts/index.ts +++ b/arkoala-arkts/arkui/src/generated/ts/index.ts @@ -2,3 +2,4 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" export * from "./TestNativeModule" +export * from "./context" diff --git a/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts b/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts index 83db5d1ce..9d54406fd 100644 --- a/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts +++ b/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts @@ -24,6 +24,7 @@ import { SizeOptions } from "./generated/ArkUnitsInterfaces" import { ArkUIGeneratedNativeModule } from "#components" import { int32 } from "@koalaui/common" import { nullptr } from "@koalaui/interop" +import { Context } from "./context" export class Font_UIContext { @@ -95,6 +96,12 @@ export class UIContext { ArkUIGeneratedNativeModule._SystemOps_restoreInstanceId(); return null; } + getHostContext(): Context | undefined { + ArkUIGeneratedNativeModule._SystemOps_syncInstanceId(this.instanceId_); + let context = new Context(); + ArkUIGeneratedNativeModule._SystemOps_restoreInstanceId(); + return context; + } } export abstract class FrameCallback { abstract onFrame(frameTimeInNano: number): void; diff --git a/arkoala-arkts/arkui/types/index-full.d.ts b/arkoala-arkts/arkui/types/index-full.d.ts index b044fd358..168ef06fa 100644 --- a/arkoala-arkts/arkui/types/index-full.d.ts +++ b/arkoala-arkts/arkui/types/index-full.d.ts @@ -1244,7 +1244,6 @@ declare interface AnimatableArithmetic { } declare function getContext(component?: Object): Context; declare interface Context { - _ContextStub: string; } declare function postCardAction(component: Object, action: Object): void; declare interface Configuration { -- Gitee From 152889999354c5b2cb8820909cf8116f615818f7 Mon Sep 17 00:00:00 2001 From: wanglili12 Date: Thu, 20 Mar 2025 16:04:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?getHostContext=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglili12 --- arkoala-arkts/arkui/src/context.ts | 25 ------------------- .../src/generated/ArkCommonInterfaces.ts | 7 +++--- .../src/generated/ArkSystemOpsMaterialized.ts | 8 ++++++ .../arkui/src/generated/GlobalScope.ts | 3 ++- .../arkts/ArkUIGeneratedNativeModule.ts | 2 ++ .../arkui/src/generated/arkts/context.ts | 23 ----------------- .../arkui/src/generated/arkts/index.ts | 3 +-- .../arkui/src/generated/arkts/type_check.ts | 3 ++- .../arkui/src/generated/peers/Deserializer.ts | 9 ++++--- .../arkui/src/generated/peers/GlobalScope.ts | 3 ++- .../arkui/src/generated/peers/Serializer.ts | 7 +++--- .../arkui/src/generated/ts/context.ts | 16 ------------ arkoala-arkts/arkui/src/generated/ts/index.ts | 1 - .../arkui/src/generated/ts/type_check.ts | 3 ++- .../arkui/src/ohos.arkui.UIContext.ts | 7 +++--- arkoala-arkts/arkui/types/index-full.d.ts | 1 + .../src/generated/arkoala_api_generated.h | 1 + .../native/src/generated/bridge_generated.cc | 4 +++ .../native/src/generated/dummy_impl.cc | 11 ++++++++ .../native/src/generated/real_impl.cc | 5 ++++ incremental/tools/panda/package.json | 2 +- 21 files changed, 58 insertions(+), 86 deletions(-) delete mode 100644 arkoala-arkts/arkui/src/context.ts delete mode 100644 arkoala-arkts/arkui/src/generated/arkts/context.ts delete mode 100644 arkoala-arkts/arkui/src/generated/ts/context.ts diff --git a/arkoala-arkts/arkui/src/context.ts b/arkoala-arkts/arkui/src/context.ts deleted file mode 100644 index 408f02d30..000000000 --- a/arkoala-arkts/arkui/src/context.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { Context1 } from "#components" - -export class Context { - constructor() { - //Context1.xxx 原能力获取Context的ani接口 - } -} \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/ArkCommonInterfaces.ts b/arkoala-arkts/arkui/src/generated/ArkCommonInterfaces.ts index 6819abcf0..6399df40a 100644 --- a/arkoala-arkts/arkui/src/generated/ArkCommonInterfaces.ts +++ b/arkoala-arkts/arkui/src/generated/ArkCommonInterfaces.ts @@ -49,6 +49,7 @@ import { AttributeModifier } from "./../handwritten" import { GestureModifier } from "./ArkGestureModifierMaterialized" import { ScrollState } from "./ArkListInterfaces" import { AccessibilityHoverEvent } from "./ArkAccessibilityHoverEventMaterialized" +import { Context } from "../ohos.arkui.UIContext" export interface ComponentOptions { freezeWhenInactive: boolean; } @@ -67,9 +68,9 @@ export interface ProvideOptions { export interface AnimatableArithmetic { } declare function getContext(arg0: Object): Context -export interface Context { - _ContextStub: string; -} +// export interface Context { +// _ContextStub: string; +// } declare function postCardAction(arg0: Object, arg1: Object): void export interface Configuration { colorMode: string; diff --git a/arkoala-arkts/arkui/src/generated/ArkSystemOpsMaterialized.ts b/arkoala-arkts/arkui/src/generated/ArkSystemOpsMaterialized.ts index 49851f125..a8c52a928 100644 --- a/arkoala-arkts/arkui/src/generated/ArkSystemOpsMaterialized.ts +++ b/arkoala-arkts/arkui/src/generated/ArkSystemOpsMaterialized.ts @@ -23,6 +23,7 @@ import { Serializer } from "./peers/Serializer" import { CallbackKind } from "./peers/CallbackKind" import { Deserializer } from "./peers/Deserializer" import { CallbackTransformer } from "./peers/CallbackTransformer" +import { Context } from "../ohos.arkui.UIContext" export class SystemOps { public static StartFrame(): KPointer { return SystemOps.StartFrame_serialize() @@ -41,6 +42,9 @@ export class SystemOps { SystemOps.restoreInstanceId_serialize() return } + public static getHostContext(): KPointer { + return SystemOps.getHostContext_serialize() + } private static StartFrame_serialize(): KPointer { const retval = ArkUIGeneratedNativeModule._SystemOps_StartFrame() return retval @@ -54,4 +58,8 @@ export class SystemOps { private static restoreInstanceId_serialize(): void { ArkUIGeneratedNativeModule._SystemOps_restoreInstanceId() } + private static getHostContext_serialize(): KPointer { + const retval = ArkUIGeneratedNativeModule._SystemOps_getHostContext() + return retval + } } diff --git a/arkoala-arkts/arkui/src/generated/GlobalScope.ts b/arkoala-arkts/arkui/src/generated/GlobalScope.ts index f3f6dec35..60c16900b 100644 --- a/arkoala-arkts/arkui/src/generated/GlobalScope.ts +++ b/arkoala-arkts/arkui/src/generated/GlobalScope.ts @@ -16,10 +16,11 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! -import { Context, AnimateParam } from "./ArkCommonInterfaces" +import { AnimateParam } from "./ArkCommonInterfaces" import { GlobalScope } from "./peers/GlobalScope" import { Resource } from "./ArkResourceInterfaces" import { Callback_Void } from "./SyntheticDeclarations" +import { Context } from "../ohos.arkui.UIContext" export function getContext(component?: Object | undefined): Context { return GlobalScope.getContext(component) } diff --git a/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts b/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts index fa8b42549..de3f3f453 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts @@ -3130,6 +3130,8 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _SystemOps_restoreInstanceId(): void @ani.unsafe.Quick + native static _SystemOps_getHostContext(): KPointer + @ani.unsafe.Quick native static _FocusController_requestFocus(key: KStringPtr): void @ani.unsafe.Direct native static _DrawingCanvas_ctor(pixelmap: KPointer): KPointer diff --git a/arkoala-arkts/arkui/src/generated/arkts/context.ts b/arkoala-arkts/arkui/src/generated/arkts/context.ts deleted file mode 100644 index cf426948b..000000000 --- a/arkoala-arkts/arkui/src/generated/arkts/context.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { loadNativeModuleLibrary } from "@koalaui/interop" - -export class Context1 { - static { - loadNativeModuleLibrary("application.Context") - - } -} \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/arkts/index.ts b/arkoala-arkts/arkui/src/generated/arkts/index.ts index ab122c29d..69e843017 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/index.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/index.ts @@ -1,5 +1,4 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" -export * from "./TestNativeModule" -export * from "./context" \ No newline at end of file +export * from "./TestNativeModule" \ No newline at end of file diff --git a/arkoala-arkts/arkui/src/generated/arkts/type_check.ts b/arkoala-arkts/arkui/src/generated/arkts/type_check.ts index 2e0e6997f..5a4da4bbd 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/type_check.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/type_check.ts @@ -5,7 +5,7 @@ import { DoubleAnimationParam, Callback_Extender_OnProgress, Callback_Extender_O import { Curve, FontStyle, FontWeight, TextAlign, TextOverflow, TextCase, WordBreak, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, DialogButtonStyle, AnimationStatus, FillMode, PlayMode, TextHeightAdaptivePolicy, CheckBoxShape, LineCapStyle, LineJoinStyle, HorizontalAlign, FlexAlign, TextDecorationType, TextDecorationStyle, SharedTransitionEffectType, VerticalAlign, TransitionType, MouseButton, MouseAction, AccessibilityHoverType, TouchType, KeyType, KeySource, Placement, ArrowPointPosition, ClickEffectLevel, NestedScrollMode, PixelRoundCalcPolicy, BarState, EdgeEffect, IlluminatedType, EmbeddedType, ImageFit, Edge, Week, RelateType, FlexDirection, FlexWrap, CopyOptions, TitleHeight, ImageSpanAlignment, TextContentStyle, XComponentType, ScrollSource, LineBreakStrategy, EllipsisMode, OptionWidthMode, FoldStatus, AppRotation, MarqueeUpdateStrategy, TextSelectableMode, WidthBreakpoint, HeightBreakpoint } from "./../ArkEnumsInterfaces" import { ICurve } from "./../ArkICurveMaterialized" import { AnimationExtender } from "./../ArkAnimationExtenderMaterialized" -import { AnimateParam, TranslateOptions, UIContext, CommonMethod, Rectangle, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, OutlineStyle, AccessibilityCallback, TransitionOptions, MotionBlurOptions, InvertOptions, ScaleOptions, RotateOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, CustomBuilder, DragItemInfo, UniformDataType, PreDragStatus, MotionPathOptions, ShadowOptions, ShadowStyle, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, SafeAreaType, SafeAreaEdge, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, ComponentContent, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, DismissReason, HoverModeAreaType, CommonConfiguration, ContentModifier, PickerTextStyle, PickerDialogButtonStyle, CommonShapeMethod, PointLightStyle, ComponentOptions, InputCounterOptions, TextDecorationOptions, ProvideOptions, AnimatableArithmetic, Context, Configuration, ExpectedFrameRateRange, FinishCallbackType, TouchTestStrategy, TransitionHierarchyStrategy, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, TransitionEdge, TransitionEffects, DrawContext, PreviewParams, ItemDragInfo, EventTarget, SourceType, SourceTool, RepeatMode, BlurStyleActivePolicy, ThemeColorMode, AdaptiveColor, BlurStyleOptions, ShadowType, MultiShadowOptions, LayoutSafeAreaType, LayoutSafeAreaEdge, SheetSize, LinearGradient_common, TouchObject, HistoricalPoint, DragBehavior, Summary, DragResult, IntentionCode, BindOptions, DismissContentCoverAction, SheetTitleOptions, SheetType, SheetMode, ScrollSizeMode, SheetKeyboardAvoidMode, SheetDismiss, DismissSheetAction, SpringBackAction, PopupMessageOptions, DismissPopupAction, MenuPreviewMode, ContextMenuAnimationOptions, RectResult, FadingEdgeOptions, NestedScrollOptions, SymbolGlyphModifier, DragPreviewMode, MenuPolicy, ImageModifier, CommonAttribute, CommonInterface, OverlayOffset, FractionStop, MotionBlurAnchor, LayoutBorderInfo, LayoutInfo, LayoutChild, GeometryInfo, SizeResult, Layoutable, MeasureResult, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, CaretOffset, ContentClipMode, ScrollableCommonMethod, EdgeEffectOptions, ScrollResult, OnWillScrollCallback, DynamicNode, OnMoveHandler, LightSource, KeyframeAnimateParam, KeyframeState, Callback, VisibleAreaEventOptions, HoverCallback, UIGestureEvent, SelectionOptions, KeyboardAvoidMode } from "./../ArkCommonInterfaces" +import { AnimateParam, TranslateOptions, UIContext, CommonMethod, Rectangle, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, OutlineStyle, AccessibilityCallback, TransitionOptions, MotionBlurOptions, InvertOptions, ScaleOptions, RotateOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, CustomBuilder, DragItemInfo, UniformDataType, PreDragStatus, MotionPathOptions, ShadowOptions, ShadowStyle, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, SafeAreaType, SafeAreaEdge, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, ComponentContent, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, DismissReason, HoverModeAreaType, CommonConfiguration, ContentModifier, PickerTextStyle, PickerDialogButtonStyle, CommonShapeMethod, PointLightStyle, ComponentOptions, InputCounterOptions, TextDecorationOptions, ProvideOptions, AnimatableArithmetic, Configuration, ExpectedFrameRateRange, FinishCallbackType, TouchTestStrategy, TransitionHierarchyStrategy, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, TransitionEdge, TransitionEffects, DrawContext, PreviewParams, ItemDragInfo, EventTarget, SourceType, SourceTool, RepeatMode, BlurStyleActivePolicy, ThemeColorMode, AdaptiveColor, BlurStyleOptions, ShadowType, MultiShadowOptions, LayoutSafeAreaType, LayoutSafeAreaEdge, SheetSize, LinearGradient_common, TouchObject, HistoricalPoint, DragBehavior, Summary, DragResult, IntentionCode, BindOptions, DismissContentCoverAction, SheetTitleOptions, SheetType, SheetMode, ScrollSizeMode, SheetKeyboardAvoidMode, SheetDismiss, DismissSheetAction, SpringBackAction, PopupMessageOptions, DismissPopupAction, MenuPreviewMode, ContextMenuAnimationOptions, RectResult, FadingEdgeOptions, NestedScrollOptions, SymbolGlyphModifier, DragPreviewMode, MenuPolicy, ImageModifier, CommonAttribute, CommonInterface, OverlayOffset, FractionStop, MotionBlurAnchor, LayoutBorderInfo, LayoutInfo, LayoutChild, GeometryInfo, SizeResult, Layoutable, MeasureResult, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, CaretOffset, ContentClipMode, ScrollableCommonMethod, EdgeEffectOptions, ScrollResult, OnWillScrollCallback, DynamicNode, OnMoveHandler, LightSource, KeyframeAnimateParam, KeyframeState, Callback, VisibleAreaEventOptions, HoverCallback, UIGestureEvent, SelectionOptions, KeyboardAvoidMode } from "./../ArkCommonInterfaces" import { PointerStyle, Callback_RangeUpdate } from "./../ArkArkuiCustomInterfaces" import { UnifiedData } from "./../ArkUnifiedDataMaterialized" import { LazyForEachOps } from "./../ArkLazyForEachOpsMaterialized" @@ -312,6 +312,7 @@ import { UrlStyle } from "./../ArkUrlStyleMaterialized" import { LinearIndicatorController } from "./../ArkLinearIndicatorControllerMaterialized" import { LinearIndicatorStartOptions, LinearIndicatorStyle, LinearIndicatorInterface, LinearIndicatorAttribute, OnLinearIndicatorChangeCallback } from "./../ArkLinearindicatorInterfaces" import { RawFileDescriptor } from "./../ArkRawFileDescriptorInterfaces" +import { Context } from "../../ohos.arkui.UIContext" export class TypeChecker { static typeInstanceOf(value: Object, prop: string): boolean { return value instanceof T diff --git a/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts b/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts index 53ca46e6c..8238815b1 100644 --- a/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts +++ b/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts @@ -22,7 +22,7 @@ import { CallbackKind } from "./CallbackKind" import { NativeBuffer, KSerializerBuffer, KUint8ArrayPtr, InteropNativeModule } from "@koalaui/interop" import { TypeChecker } from "#components" import { CallbackTransformer } from "./CallbackTransformer" -import { AccessibilityCallback, CustomBuilder, GestureRecognizerJudgeBeginCallback, HoverCallback, OnMoveHandler, OnScrollCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, ShadowType, SymbolGlyphModifier, ShadowOptions, SheetSize, DrawContext, ShadowStyle, ComponentContent, SheetTitleOptions, TransitionEffects, TranslateOptions, RotateOptions, ScaleOptions, TransitionEdge, AnimateParam, MenuPreviewMode, DismissPopupAction, DragPreviewMode, OutlineStyle, SourceTool, SourceType, EventTarget, HoverModeAreaType, BlurStyle, Rectangle, PickerTextStyle, PickerDialogButtonStyle, MenuPolicy, BlurStyleActivePolicy, BlurOptions, AdaptiveColor, ThemeColorMode, ExpectedFrameRateRange, FinishCallbackType, SheetKeyboardAvoidMode, UIContext, SheetType, ScrollSizeMode, SheetMode, SpringBackAction, DismissSheetAction, SheetDismiss, DismissContentCoverAction, ModalTransition, ContextMenuAnimationOptions, PopupMessageOptions, TransitionHierarchyStrategy, OverlayOffset, ImageModifier, MotionPathOptions, LinearGradient_common, ScrollableCommonMethod, CommonMethod, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, TransitionOptions, MotionBlurOptions, InvertOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, DragItemInfo, UniformDataType, PreDragStatus, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, SafeAreaType, SafeAreaEdge, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ContentCoverOptions, SheetOptions, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions, RectResult, TouchObject, HistoricalPoint, TextDecorationOptions, InputCounterOptions, CaretOffset, SelectionOptions, BlurStyleOptions, ContentModifier, LayoutSafeAreaType, LayoutSafeAreaEdge, ItemDragInfo, KeyboardAvoidMode, UIGestureEvent, VisibleAreaEventOptions, MeasureResult, SizeResult, DismissReason, BindOptions, FractionStop, LocalizedVerticalAlignParam, LocalizedHorizontalAlignParam, MotionBlurAnchor, RepeatMode, TouchTestStrategy, IntentionCode, DragResult, Summary, DragBehavior, Context, LightSource, MultiShadowOptions, PointLightStyle } from "./../ArkCommonInterfaces" +import { AccessibilityCallback, CustomBuilder, GestureRecognizerJudgeBeginCallback, HoverCallback, OnMoveHandler, OnScrollCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, ShadowType, SymbolGlyphModifier, ShadowOptions, SheetSize, DrawContext, ShadowStyle, ComponentContent, SheetTitleOptions, TransitionEffects, TranslateOptions, RotateOptions, ScaleOptions, TransitionEdge, AnimateParam, MenuPreviewMode, DismissPopupAction, DragPreviewMode, OutlineStyle, SourceTool, SourceType, EventTarget, HoverModeAreaType, BlurStyle, Rectangle, PickerTextStyle, PickerDialogButtonStyle, MenuPolicy, BlurStyleActivePolicy, BlurOptions, AdaptiveColor, ThemeColorMode, ExpectedFrameRateRange, FinishCallbackType, SheetKeyboardAvoidMode, UIContext, SheetType, ScrollSizeMode, SheetMode, SpringBackAction, DismissSheetAction, SheetDismiss, DismissContentCoverAction, ModalTransition, ContextMenuAnimationOptions, PopupMessageOptions, TransitionHierarchyStrategy, OverlayOffset, ImageModifier, MotionPathOptions, LinearGradient_common, ScrollableCommonMethod, CommonMethod, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, TransitionOptions, MotionBlurOptions, InvertOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, DragItemInfo, UniformDataType, PreDragStatus, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, SafeAreaType, SafeAreaEdge, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ContentCoverOptions, SheetOptions, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions, RectResult, TouchObject, HistoricalPoint, TextDecorationOptions, InputCounterOptions, CaretOffset, SelectionOptions, BlurStyleOptions, ContentModifier, LayoutSafeAreaType, LayoutSafeAreaEdge, ItemDragInfo, KeyboardAvoidMode, UIGestureEvent, VisibleAreaEventOptions, MeasureResult, SizeResult, DismissReason, BindOptions, FractionStop, LocalizedVerticalAlignParam, LocalizedHorizontalAlignParam, MotionBlurAnchor, RepeatMode, TouchTestStrategy, IntentionCode, DragResult, Summary, DragBehavior, LightSource, MultiShadowOptions, PointLightStyle } from "./../ArkCommonInterfaces" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, LabelStyle, ControlSize, ButtonOptions } from "./../ArkButtonInterfaces" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../ArkAnimationExtenderInterfaces" import { Callback_RangeUpdate, PointerStyle } from "./../ArkArkuiCustomInterfaces" @@ -297,6 +297,7 @@ import { FrictionMotion, FrictionMotionInternal } from "./../ArkFrictionMotionMa import { SpringMotion, SpringMotionInternal } from "./../ArkSpringMotionMaterialized" import { ReplaceSymbolEffect, ReplaceSymbolEffectInternal } from "./../ArkReplaceSymbolEffectMaterialized" import { ScaleSymbolEffect, ScaleSymbolEffectInternal } from "./../ArkScaleSymbolEffectMaterialized" +import { Context } from "../../ohos.arkui.UIContext" export class Deserializer extends DeserializerBase { constructor(data: KSerializerBuffer | KUint8ArrayPtr, length: int32) { @@ -10217,9 +10218,9 @@ export class Deserializer extends DeserializerBase { } readContext(): Context { let valueDeserializer : Deserializer = this - const _ContextStub_result : string = (valueDeserializer.readString() as string) - let value : Context = ({_ContextStub: _ContextStub_result} as Context) - return value + // const _ContextStub_result : string = (valueDeserializer.readString() as string) + // let value : Context = ({_ContextStub: _ContextStub_result} as Context) + return {} as Context } readColumnSplitDividerStyle(): ColumnSplitDividerStyle { let valueDeserializer : Deserializer = this diff --git a/arkoala-arkts/arkui/src/generated/peers/GlobalScope.ts b/arkoala-arkts/arkui/src/generated/peers/GlobalScope.ts index 485ca295a..d15ca1215 100644 --- a/arkoala-arkts/arkui/src/generated/peers/GlobalScope.ts +++ b/arkoala-arkts/arkui/src/generated/peers/GlobalScope.ts @@ -16,7 +16,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! -import { Context, AnimateParam } from "./../ArkCommonInterfaces" +import { AnimateParam } from "./../ArkCommonInterfaces" import { Resource } from "./../ArkResourceInterfaces" import { Callback_Void } from "./../SyntheticDeclarations" import { Profiler } from "./../ArkProfilerNamespace" @@ -28,6 +28,7 @@ import { CallbackKind } from "./CallbackKind" import { Deserializer } from "./Deserializer" import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { CallbackTransformer } from "./CallbackTransformer" +import { Context } from "../../ohos.arkui.UIContext" export class GlobalScope { public static getContext(component?: Object): Context { const component_casted = component as (Object | undefined) diff --git a/arkoala-arkts/arkui/src/generated/peers/Serializer.ts b/arkoala-arkts/arkui/src/generated/peers/Serializer.ts index 1b3cb7a68..f934614f4 100644 --- a/arkoala-arkts/arkui/src/generated/peers/Serializer.ts +++ b/arkoala-arkts/arkui/src/generated/peers/Serializer.ts @@ -18,7 +18,7 @@ import { int32, float32, unsafeCast, int64 } from "@koalaui/common" import { NativeBuffer, KSerializerBuffer, KUint8ArrayPtr, InteropNativeModule } from "@koalaui/interop" import { TypeChecker } from "#components" import { CallbackTransformer } from "./CallbackTransformer" -import { AccessibilityCallback, CustomBuilder, GestureRecognizerJudgeBeginCallback, HoverCallback, OnMoveHandler, OnScrollCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, ShadowType, SymbolGlyphModifier, ShadowOptions, SheetSize, DrawContext, ShadowStyle, ComponentContent, SheetTitleOptions, TransitionEffects, TranslateOptions, RotateOptions, ScaleOptions, TransitionEdge, AnimateParam, MenuPreviewMode, DismissPopupAction, DragPreviewMode, OutlineStyle, SourceTool, SourceType, EventTarget, HoverModeAreaType, BlurStyle, Rectangle, PickerTextStyle, PickerDialogButtonStyle, MenuPolicy, BlurStyleActivePolicy, BlurOptions, AdaptiveColor, ThemeColorMode, ExpectedFrameRateRange, FinishCallbackType, SheetKeyboardAvoidMode, UIContext, SheetType, ScrollSizeMode, SheetMode, SpringBackAction, DismissSheetAction, SheetDismiss, DismissContentCoverAction, ModalTransition, ContextMenuAnimationOptions, PopupMessageOptions, TransitionHierarchyStrategy, OverlayOffset, ImageModifier, MotionPathOptions, LinearGradient_common, ScrollableCommonMethod, CommonMethod, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, TransitionOptions, MotionBlurOptions, InvertOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, DragItemInfo, UniformDataType, PreDragStatus, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, SafeAreaType, SafeAreaEdge, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ContentCoverOptions, SheetOptions, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions, RectResult, TouchObject, HistoricalPoint, TextDecorationOptions, InputCounterOptions, CaretOffset, SelectionOptions, BlurStyleOptions, ContentModifier, LayoutSafeAreaType, LayoutSafeAreaEdge, ItemDragInfo, KeyboardAvoidMode, UIGestureEvent, VisibleAreaEventOptions, MeasureResult, SizeResult, DismissReason, BindOptions, FractionStop, LocalizedVerticalAlignParam, LocalizedHorizontalAlignParam, MotionBlurAnchor, RepeatMode, TouchTestStrategy, IntentionCode, DragResult, Summary, DragBehavior, Context, LightSource, MultiShadowOptions, PointLightStyle } from "./../ArkCommonInterfaces" +import { AccessibilityCallback, CustomBuilder, GestureRecognizerJudgeBeginCallback, HoverCallback, OnMoveHandler, OnScrollCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, ShadowType, SymbolGlyphModifier, ShadowOptions, SheetSize, DrawContext, ShadowStyle, ComponentContent, SheetTitleOptions, TransitionEffects, TranslateOptions, RotateOptions, ScaleOptions, TransitionEdge, AnimateParam, MenuPreviewMode, DismissPopupAction, DragPreviewMode, OutlineStyle, SourceTool, SourceType, EventTarget, HoverModeAreaType, BlurStyle, Rectangle, PickerTextStyle, PickerDialogButtonStyle, MenuPolicy, BlurStyleActivePolicy, BlurOptions, AdaptiveColor, ThemeColorMode, ExpectedFrameRateRange, FinishCallbackType, SheetKeyboardAvoidMode, UIContext, SheetType, ScrollSizeMode, SheetMode, SpringBackAction, DismissSheetAction, SheetDismiss, DismissContentCoverAction, ModalTransition, ContextMenuAnimationOptions, PopupMessageOptions, TransitionHierarchyStrategy, OverlayOffset, ImageModifier, MotionPathOptions, LinearGradient_common, ScrollableCommonMethod, CommonMethod, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, TransitionOptions, MotionBlurOptions, InvertOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, DragItemInfo, UniformDataType, PreDragStatus, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, SafeAreaType, SafeAreaEdge, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ContentCoverOptions, SheetOptions, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions, RectResult, TouchObject, HistoricalPoint, TextDecorationOptions, InputCounterOptions, CaretOffset, SelectionOptions, BlurStyleOptions, ContentModifier, LayoutSafeAreaType, LayoutSafeAreaEdge, ItemDragInfo, KeyboardAvoidMode, UIGestureEvent, VisibleAreaEventOptions, MeasureResult, SizeResult, DismissReason, BindOptions, FractionStop, LocalizedVerticalAlignParam, LocalizedHorizontalAlignParam, MotionBlurAnchor, RepeatMode, TouchTestStrategy, IntentionCode, DragResult, Summary, DragBehavior, LightSource, MultiShadowOptions, PointLightStyle } from "./../ArkCommonInterfaces" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, LabelStyle, ControlSize, ButtonOptions } from "./../ArkButtonInterfaces" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../ArkAnimationExtenderInterfaces" import { Callback_RangeUpdate, PointerStyle } from "./../ArkArkuiCustomInterfaces" @@ -293,6 +293,7 @@ import { FrictionMotion, FrictionMotionInternal } from "./../ArkFrictionMotionMa import { SpringMotion, SpringMotionInternal } from "./../ArkSpringMotionMaterialized" import { ReplaceSymbolEffect, ReplaceSymbolEffectInternal } from "./../ArkReplaceSymbolEffectMaterialized" import { ScaleSymbolEffect, ScaleSymbolEffectInternal } from "./../ArkScaleSymbolEffectMaterialized" +import { Context } from "../../ohos.arkui.UIContext" export class Serializer extends SerializerBase { private static pool?: Array | undefined = undefined private static poolTop: int32 = -1 @@ -10590,8 +10591,8 @@ export class Serializer extends SerializerBase { } writeContext(value: Context): void { let valueSerializer : Serializer = this - const value__ContextStub = value._ContextStub - valueSerializer.writeString(value__ContextStub) + // const value__ContextStub = value._ContextStub + // valueSerializer.writeString(value__ContextStub) } writeColumnSplitDividerStyle(value: ColumnSplitDividerStyle): void { let valueSerializer : Serializer = this diff --git a/arkoala-arkts/arkui/src/generated/ts/context.ts b/arkoala-arkts/arkui/src/generated/ts/context.ts deleted file mode 100644 index 35f598c04..000000000 --- a/arkoala-arkts/arkui/src/generated/ts/context.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export const Context1: any = undefined diff --git a/arkoala-arkts/arkui/src/generated/ts/index.ts b/arkoala-arkts/arkui/src/generated/ts/index.ts index 38beac31c..4aedac570 100644 --- a/arkoala-arkts/arkui/src/generated/ts/index.ts +++ b/arkoala-arkts/arkui/src/generated/ts/index.ts @@ -2,4 +2,3 @@ export * from "./type_check" export * from "./ArkUINativeModule" export * from "./ArkUIGeneratedNativeModule" export * from "./TestNativeModule" -export * from "./context" diff --git a/arkoala-arkts/arkui/src/generated/ts/type_check.ts b/arkoala-arkts/arkui/src/generated/ts/type_check.ts index 59937ba3b..e0127f4d0 100644 --- a/arkoala-arkts/arkui/src/generated/ts/type_check.ts +++ b/arkoala-arkts/arkui/src/generated/ts/type_check.ts @@ -5,7 +5,7 @@ import { DoubleAnimationParam, Callback_Extender_OnProgress, Callback_Extender_O import { Curve, FontStyle, FontWeight, TextAlign, TextOverflow, TextCase, WordBreak, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, DialogButtonStyle, AnimationStatus, FillMode, PlayMode, TextHeightAdaptivePolicy, CheckBoxShape, LineCapStyle, LineJoinStyle, HorizontalAlign, FlexAlign, TextDecorationType, TextDecorationStyle, SharedTransitionEffectType, VerticalAlign, TransitionType, MouseButton, MouseAction, AccessibilityHoverType, TouchType, KeyType, KeySource, Placement, ArrowPointPosition, ClickEffectLevel, NestedScrollMode, PixelRoundCalcPolicy, BarState, EdgeEffect, IlluminatedType, EmbeddedType, ImageFit, Edge, Week, RelateType, FlexDirection, FlexWrap, CopyOptions, TitleHeight, ImageSpanAlignment, TextContentStyle, XComponentType, ScrollSource, LineBreakStrategy, EllipsisMode, OptionWidthMode, FoldStatus, AppRotation, MarqueeUpdateStrategy, TextSelectableMode, WidthBreakpoint, HeightBreakpoint } from "./../ArkEnumsInterfaces" import { ICurve } from "./../ArkICurveMaterialized" import { AnimationExtender } from "./../ArkAnimationExtenderMaterialized" -import { AnimateParam, TranslateOptions, UIContext, CommonMethod, Rectangle, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, OutlineStyle, AccessibilityCallback, TransitionOptions, MotionBlurOptions, InvertOptions, ScaleOptions, RotateOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, CustomBuilder, DragItemInfo, UniformDataType, PreDragStatus, MotionPathOptions, ShadowOptions, ShadowStyle, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, SafeAreaType, SafeAreaEdge, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, ComponentContent, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, DismissReason, HoverModeAreaType, CommonConfiguration, ContentModifier, PickerTextStyle, PickerDialogButtonStyle, CommonShapeMethod, PointLightStyle, ComponentOptions, InputCounterOptions, TextDecorationOptions, ProvideOptions, AnimatableArithmetic, Context, Configuration, ExpectedFrameRateRange, FinishCallbackType, TouchTestStrategy, TransitionHierarchyStrategy, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, TransitionEdge, TransitionEffects, DrawContext, PreviewParams, ItemDragInfo, EventTarget, SourceType, SourceTool, RepeatMode, BlurStyleActivePolicy, ThemeColorMode, AdaptiveColor, BlurStyleOptions, ShadowType, MultiShadowOptions, LayoutSafeAreaType, LayoutSafeAreaEdge, SheetSize, LinearGradient_common, TouchObject, HistoricalPoint, DragBehavior, Summary, DragResult, IntentionCode, BindOptions, DismissContentCoverAction, SheetTitleOptions, SheetType, SheetMode, ScrollSizeMode, SheetKeyboardAvoidMode, SheetDismiss, DismissSheetAction, SpringBackAction, PopupMessageOptions, DismissPopupAction, MenuPreviewMode, ContextMenuAnimationOptions, RectResult, FadingEdgeOptions, NestedScrollOptions, SymbolGlyphModifier, DragPreviewMode, MenuPolicy, ImageModifier, CommonAttribute, CommonInterface, OverlayOffset, FractionStop, MotionBlurAnchor, LayoutBorderInfo, LayoutInfo, LayoutChild, GeometryInfo, SizeResult, Layoutable, MeasureResult, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, CaretOffset, ContentClipMode, ScrollableCommonMethod, EdgeEffectOptions, ScrollResult, OnWillScrollCallback, DynamicNode, OnMoveHandler, LightSource, KeyframeAnimateParam, KeyframeState, Callback, VisibleAreaEventOptions, HoverCallback, UIGestureEvent, SelectionOptions, KeyboardAvoidMode } from "./../ArkCommonInterfaces" +import { AnimateParam, TranslateOptions, UIContext, CommonMethod, Rectangle, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, VisualEffect, Filter, BorderImageOption, OutlineStyle, AccessibilityCallback, TransitionOptions, MotionBlurOptions, InvertOptions, ScaleOptions, RotateOptions, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, CustomBuilder, DragItemInfo, UniformDataType, PreDragStatus, MotionPathOptions, ShadowOptions, ShadowStyle, StateStyles, PixelStretchEffectOptions, BackgroundBrightnessOptions, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, SafeAreaType, SafeAreaEdge, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, ComponentContent, OverlayOptions, BlendMode, BlendApplyType, Blender, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, DismissReason, HoverModeAreaType, CommonConfiguration, ContentModifier, PickerTextStyle, PickerDialogButtonStyle, CommonShapeMethod, PointLightStyle, ComponentOptions, InputCounterOptions, TextDecorationOptions, ProvideOptions, AnimatableArithmetic, Configuration, ExpectedFrameRateRange, FinishCallbackType, TouchTestStrategy, TransitionHierarchyStrategy, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, TransitionEdge, TransitionEffects, DrawContext, PreviewParams, ItemDragInfo, EventTarget, SourceType, SourceTool, RepeatMode, BlurStyleActivePolicy, ThemeColorMode, AdaptiveColor, BlurStyleOptions, ShadowType, MultiShadowOptions, LayoutSafeAreaType, LayoutSafeAreaEdge, SheetSize, LinearGradient_common, TouchObject, HistoricalPoint, DragBehavior, Summary, DragResult, IntentionCode, BindOptions, DismissContentCoverAction, SheetTitleOptions, SheetType, SheetMode, ScrollSizeMode, SheetKeyboardAvoidMode, SheetDismiss, DismissSheetAction, SpringBackAction, PopupMessageOptions, DismissPopupAction, MenuPreviewMode, ContextMenuAnimationOptions, RectResult, FadingEdgeOptions, NestedScrollOptions, SymbolGlyphModifier, DragPreviewMode, MenuPolicy, ImageModifier, CommonAttribute, CommonInterface, OverlayOffset, FractionStop, MotionBlurAnchor, LayoutBorderInfo, LayoutInfo, LayoutChild, GeometryInfo, SizeResult, Layoutable, MeasureResult, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, CaretOffset, ContentClipMode, ScrollableCommonMethod, EdgeEffectOptions, ScrollResult, OnWillScrollCallback, DynamicNode, OnMoveHandler, LightSource, KeyframeAnimateParam, KeyframeState, Callback, VisibleAreaEventOptions, HoverCallback, UIGestureEvent, SelectionOptions, KeyboardAvoidMode } from "./../ArkCommonInterfaces" import { PointerStyle, Callback_RangeUpdate } from "./../ArkArkuiCustomInterfaces" import { UnifiedData } from "./../ArkUnifiedDataMaterialized" import { LazyForEachOps } from "./../ArkLazyForEachOpsMaterialized" @@ -312,6 +312,7 @@ import { UrlStyle } from "./../ArkUrlStyleMaterialized" import { LinearIndicatorController } from "./../ArkLinearIndicatorControllerMaterialized" import { LinearIndicatorStartOptions, LinearIndicatorStyle, LinearIndicatorInterface, LinearIndicatorAttribute, OnLinearIndicatorChangeCallback } from "./../ArkLinearindicatorInterfaces" import { RawFileDescriptor } from "./../ArkRawFileDescriptorInterfaces" +import { Context } from "../../ohos.arkui.UIContext" export class TypeChecker { static typeInstanceOf(value: Object, prop: string): boolean { return value.hasOwnProperty(prop) diff --git a/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts b/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts index 9d54406fd..618f070f2 100644 --- a/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts +++ b/arkoala-arkts/arkui/src/ohos.arkui.UIContext.ts @@ -24,9 +24,8 @@ import { SizeOptions } from "./generated/ArkUnitsInterfaces" import { ArkUIGeneratedNativeModule } from "#components" import { int32 } from "@koalaui/common" import { nullptr } from "@koalaui/interop" -import { Context } from "./context" - +export class Context {} export class Font_UIContext { instanceId_: int32 = 100000; constructor(instanceId: int32) { @@ -98,9 +97,9 @@ export class UIContext { } getHostContext(): Context | undefined { ArkUIGeneratedNativeModule._SystemOps_syncInstanceId(this.instanceId_); - let context = new Context(); + let context = ArkUIGeneratedNativeModule._SystemOps_getHostContext(); ArkUIGeneratedNativeModule._SystemOps_restoreInstanceId(); - return context; + return context as Context; } } export abstract class FrameCallback { diff --git a/arkoala-arkts/arkui/types/index-full.d.ts b/arkoala-arkts/arkui/types/index-full.d.ts index 168ef06fa..7acdb466a 100644 --- a/arkoala-arkts/arkui/types/index-full.d.ts +++ b/arkoala-arkts/arkui/types/index-full.d.ts @@ -2382,6 +2382,7 @@ declare interface RouterPageInfo { declare class UIContext { constructor(instanceId: number); getFrameNodeById(id: string): FrameNode | null; + getHostContext(): Context | undefined; getFont() : Font_UIContext; getMeasureUtils() : MeasureUtils; } diff --git a/arkoala/framework/native/src/generated/arkoala_api_generated.h b/arkoala/framework/native/src/generated/arkoala_api_generated.h index c2ee274e0..e78b642fe 100644 --- a/arkoala/framework/native/src/generated/arkoala_api_generated.h +++ b/arkoala/framework/native/src/generated/arkoala_api_generated.h @@ -19544,6 +19544,7 @@ typedef struct GENERATED_ArkUISystemOpsAccessor { void (*EndFrame)(Ark_NativePointer root); void (*syncInstanceId)(Ark_Int32 instanceId); void (*restoreInstanceId)(); + Ark_NativePointer (*getHostContext)(); } GENERATED_ArkUISystemOpsAccessor; typedef struct GENERATED_ArkUIFocusControllerAccessor { diff --git a/arkoala/framework/native/src/generated/bridge_generated.cc b/arkoala/framework/native/src/generated/bridge_generated.cc index 636ce76fb..07974a64c 100644 --- a/arkoala/framework/native/src/generated/bridge_generated.cc +++ b/arkoala/framework/native/src/generated/bridge_generated.cc @@ -17081,6 +17081,10 @@ void impl_SystemOps_restoreInstanceId() { GetAccessors()->getSystemOpsAccessor()->restoreInstanceId(); } KOALA_INTEROP_DIRECT_V0(SystemOps_restoreInstanceId) +Ark_NativePointer impl_SystemOps_getHostContext() { + return GetAccessors()->getSystemOpsAccessor()->getHostContext(); +} +KOALA_INTEROP_DIRECT_0(SystemOps_getHostContext, Ark_NativePointer) void impl_FocusController_requestFocus(const KStringPtr& key) { GetAccessors()->getFocusControllerAccessor()->requestFocus((const Ark_String*) (&key)); } diff --git a/arkoala/framework/native/src/generated/dummy_impl.cc b/arkoala/framework/native/src/generated/dummy_impl.cc index 7a932e52c..ce92bdac2 100644 --- a/arkoala/framework/native/src/generated/dummy_impl.cc +++ b/arkoala/framework/native/src/generated/dummy_impl.cc @@ -20266,6 +20266,16 @@ namespace OHOS::Ace::NG::GeneratedModifier { out.append(") \n"); appendGroupedLog(1, out); } + Ark_NativePointer GetHostContextImpl() + { + if (!needGroupedLog(1)) + return nullptr; + string out("getHostContext("); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return nullptr; + } } // SystemOpsAccessor namespace FocusControllerAccessor { void RequestFocusImpl(const Ark_String* key) @@ -34657,6 +34667,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { SystemOpsAccessor::EndFrameImpl, SystemOpsAccessor::SyncInstanceIdImpl, SystemOpsAccessor::RestoreInstanceIdImpl, + SystemOpsAccessor::GetHostContextImpl, }; return &SystemOpsAccessorImpl; } diff --git a/arkoala/framework/native/src/generated/real_impl.cc b/arkoala/framework/native/src/generated/real_impl.cc index aa6b34ec5..7f9ab61df 100644 --- a/arkoala/framework/native/src/generated/real_impl.cc +++ b/arkoala/framework/native/src/generated/real_impl.cc @@ -10456,6 +10456,10 @@ namespace OHOS::Ace::NG::GeneratedModifier { void RestoreInstanceIdImpl() { } + Ark_NativePointer GetHostContextImpl() + { + return {}; + } } // SystemOpsAccessor namespace FocusControllerAccessor { void RequestFocusImpl(const Ark_String* key) @@ -16953,6 +16957,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { SystemOpsAccessor::EndFrameImpl, SystemOpsAccessor::SyncInstanceIdImpl, SystemOpsAccessor::RestoreInstanceIdImpl, + SystemOpsAccessor::GetHostContextImpl, }; return &SystemOpsAccessorImpl; } diff --git a/incremental/tools/panda/package.json b/incremental/tools/panda/package.json index 7e08dadf8..1dab873e2 100644 --- a/incremental/tools/panda/package.json +++ b/incremental/tools/panda/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "panda:sdk:check-install": "npm ls @panda/sdk || npm run panda:sdk:install", - "panda:sdk:install": "npm install --prefix . --no-save @panda/sdk@${PANDA_SDK_VERSION:-next}", + "panda:sdk:install": "npm install --prefix . --no-save @panda/sdk@1.5.0-dev.22843", "panda:sdk:clean": "rimraf ./node_modules", "panda:sdk:build": "node ./build_panda_sdk.mjs --panda-sdk-dir=./node_modules/@panda/sdk/ --arkcompiler-build-dir=$HOME/arkcompiler --runtime-git-rev=a6704b6a --frontend-git-rev=c2166bf1 --frontend-git-patches=./fix_es2panda_1.patch:./fix_normalizing_source_paths.patch", "panda:sdk:sync": "node ./sync-panda-on-device.mjs" -- Gitee