From 2e9058553ddc364270f54ee06add2784204137aa Mon Sep 17 00:00:00 2001 From: Ilya Erokhin Date: Wed, 28 May 2025 16:46:54 +0300 Subject: [PATCH 1/2] Custom Layout regeneration for M1 and M3 Signed-off-by: Ilya Erokhin --- arkoala-arkts/arkui/sdk/generated/common.ets | 7 +- .../sdk/generated/generator_synthetic.ets | 3 +- .../arkui/sdk/generated/static_components.ets | 30 + .../arkts/ArkUIGeneratedNativeModule.ets | 26 + .../src/ets/generated/arkts/type_check.ets | 23 +- .../arkui/src/ets/generated/common.ets | 121 +++- .../src/ets/generated/generator_synthetic.ets | 3 +- .../peers/CallbackDeserializeCall.ets | 44 +- .../src/ets/generated/peers/CallbackKind.ets | 3 + .../src/ets/generated/peers/Deserializer.ets | 168 +++++- .../src/ets/generated/peers/Serializer.ets | 124 +++- .../src/ets/generated/static_components.ets | 87 +++ .../arkui/src/ets/generated/ts/type_check.ets | 50 +- .../arkts/ArkUIGeneratedNativeModule.ts | 26 + .../arkui/src/generated/arkts/type_check.ts | 23 +- arkoala-arkts/arkui/src/generated/common.ts | 121 +++- .../src/generated/generator_synthetic.ts | 3 +- .../peers/CallbackDeserializeCall.ts | 44 +- .../arkui/src/generated/peers/CallbackKind.ts | 3 + .../arkui/src/generated/peers/Deserializer.ts | 168 +++++- .../arkui/src/generated/peers/Serializer.ts | 124 +++- .../arkui/src/generated/static_components.ts | 87 +++ .../arkui/src/generated/ts/type_check.ts | 50 +- arkoala-arkts/arkui/types/index-full.d.ts | 13 +- .../native/src/generated/Serializers.h | 534 ++++++++++++++++++ .../src/generated/arkoala_api_generated.h | 112 ++++ .../native/src/generated/bridge_generated.cc | 91 +++ .../generated/callback_deserialize_call.cc | 98 ++++ .../native/src/generated/callback_kind.h | 3 + .../src/generated/callback_managed_caller.cc | 96 ++++ .../native/src/generated/dummy_impl.cc | 179 ++++++ .../native/src/generated/real_impl.cc | 97 ++++ 32 files changed, 2506 insertions(+), 55 deletions(-) diff --git a/arkoala-arkts/arkui/sdk/generated/common.ets b/arkoala-arkts/arkui/sdk/generated/common.ets index ae48557c5..8d1399967 100644 --- a/arkoala-arkts/arkui/sdk/generated/common.ets +++ b/arkoala-arkts/arkui/sdk/generated/common.ets @@ -2648,7 +2648,12 @@ export declare interface GeometryInfo extends SizeResult { padding: Padding; } export declare interface Layoutable { - stub: string; + measureResult: MeasureResult; + uniqueId?: number; + layout(position: Position): void + getMargin(): DirectionalEdgesT + getPadding(): DirectionalEdgesT + getBorderWidth(): DirectionalEdgesT } export declare interface Measurable { uniqueId?: number; diff --git a/arkoala-arkts/arkui/sdk/generated/generator_synthetic.ets b/arkoala-arkts/arkui/sdk/generated/generator_synthetic.ets index cd45721b0..2bf740998 100644 --- a/arkoala-arkts/arkui/sdk/generated/generator_synthetic.ets +++ b/arkoala-arkts/arkui/sdk/generated/generator_synthetic.ets @@ -20,8 +20,8 @@ import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer } from "@koalaui/interop" import { memo, memo_stable } from "@koalaui/runtime/annotations" import { BuilderLambda } from "@koalaui/builderLambda" +import { SizeResult, TouchResult, CustomBuilder, DragItemInfo } from "./common" import { GestureJudgeResult, GestureRecognizer } from "./gesture" -import { TouchResult, CustomBuilder, DragItemInfo } from "./common" import { HitTestMode } from "./enums" import { NavigationAnimatedTransition } from "./navigation" import { Tuple_Number_Number } from "./arkui-synthetics" @@ -34,6 +34,7 @@ import { WithThemeAttribute } from "./with_theme" import { WebKeyboardOptions, WebResourceResponse } from "./web" import { UserDataSpan, StyledString, CustomSpanMetrics } from "./styled_string" export type Callback_Pointer_Void = (value: KPointer) => void; +export type Callback_SizeResult_Void = (value: SizeResult) => void; export type Callback_Array_String_Void = (value: Array) => void; export type Callback_GestureJudgeResult_Void = (value: GestureJudgeResult) => void; export type Callback_GestureRecognizer_Void = (value: GestureRecognizer) => void; diff --git a/arkoala-arkts/arkui/sdk/generated/static_components.ets b/arkoala-arkts/arkui/sdk/generated/static_components.ets index 3a16640c2..52321568b 100644 --- a/arkoala-arkts/arkui/sdk/generated/static_components.ets +++ b/arkoala-arkts/arkui/sdk/generated/static_components.ets @@ -20,6 +20,8 @@ import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr } from "@koalaui/interop" import { memo, memo_stable } from "@koalaui/runtime/annotations" import { BuilderLambda } from "@koalaui/builderLambda" +import { GeometryInfo, Measurable, SizeResult, Layoutable } from "./common" +import { ConstraintSizeOptions } from "./units" import { UICommonBase, AttributeModifier } from "./../handwritten" export declare interface Root { attributeModifier(value: AttributeModifier | undefined): this @@ -45,3 +47,31 @@ export class ArkComponentRootStyle implements ComponentRoot { throw new Error("Not implemented") } } +export type Callback_onMeasureSize_SizeResult = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => SizeResult; +export type Callback_onPlaceChildren_Void = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => void; +export declare interface CustomLayoutRoot { + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + attributeModifier(value: AttributeModifier | undefined): this +} +export declare interface UICustomLayoutRoot { + @memo + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + @memo + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + @memo + attributeModifier(value: AttributeModifier | undefined): this +} +export class ArkCustomLayoutRootStyle implements CustomLayoutRoot { + subscribeOnMeasureSize_value?: Callback_onMeasureSize_SizeResult + subscribeOnPlaceChildren_value?: Callback_onPlaceChildren_Void + public subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this { + return this + } + public subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this { + return this + } + public attributeModifier(value: AttributeModifier | undefined): this { + throw new Error("Not implemented") + } +} diff --git a/arkoala-arkts/arkui/src/ets/generated/arkts/ArkUIGeneratedNativeModule.ets b/arkoala-arkts/arkui/src/ets/generated/arkts/ArkUIGeneratedNativeModule.ets index fbed26f85..3861c15ff 100644 --- a/arkoala-arkts/arkui/src/ets/generated/arkts/ArkUIGeneratedNativeModule.ets +++ b/arkoala-arkts/arkui/src/ets/generated/arkts/ArkUIGeneratedNativeModule.ets @@ -28,6 +28,12 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _ComponentRoot_construct(id: KInt, flags: KInt): KPointer @ani.unsafe.Direct + native static _CustomLayoutRoot_construct(id: KInt, flags: KInt): KPointer + @ani.unsafe.Direct + native static _CustomLayoutRoot_subscribeOnMeasureSize(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Direct + native static _CustomLayoutRoot_subscribeOnPlaceChildren(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Direct native static _AbilityComponent_construct(id: KInt, flags: KInt): KPointer @ani.unsafe.Direct native static _AbilityComponentInterface_setAbilityComponentOptions(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void @@ -4895,6 +4901,26 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _ProgressMask_enableBreathingAnimation(ptr: KPointer, value: KInt): void @ani.unsafe.Direct + native static _Layoutable_ctor(): KPointer + @ani.unsafe.Direct + native static _Layoutable_getFinalizer(): KPointer + @ani.unsafe.Direct + native static _Layoutable_layout(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Quick + native static _Layoutable_getMargin(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getPadding(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getBorderWidth(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getMeasureResult(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Direct + native static _Layoutable_setMeasureResult(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Quick + native static _Layoutable_getUniqueId(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Direct + native static _Layoutable_setUniqueId(ptr: KPointer, uniqueId: number): void + @ani.unsafe.Direct native static _Measurable_ctor(): KPointer @ani.unsafe.Direct native static _Measurable_getFinalizer(): KPointer diff --git a/arkoala-arkts/arkui/src/ets/generated/arkts/type_check.ets b/arkoala-arkts/arkui/src/ets/generated/arkts/type_check.ets index f2720d6ab..1e09c51a8 100644 --- a/arkoala-arkts/arkui/src/ets/generated/arkts/type_check.ets +++ b/arkoala-arkts/arkui/src/ets/generated/arkts/type_check.ets @@ -19,7 +19,7 @@ import { KBoolean, KStringPtr, NativeBuffer, MaterializedBase } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { AccessibilityHoverType, Alignment, AnimationStatus, AppRotation, ArrowPointPosition, Axis, AxisAction, AxisModel, BarState, BorderStyle, CheckBoxShape, ClickEffectLevel, Color, ColoringStrategy, CopyOptions, CrownAction, CrownSensitivity, Curve, DialogButtonStyle, Direction, DividerMode, Edge, EdgeEffect, EmbeddedType, FillMode, FlexAlign, FlexDirection, FlexWrap, FocusDrawLevel, FoldStatus, FontWeight, FunctionKey, GradientDirection, HeightBreakpoint, HitTestMode, HorizontalAlign, HoverEffect, IlluminatedType, ImageFit, ImageRepeat, ImageSize, ImageSpanAlignment, InteractionHand, ItemAlign, KeySource, KeyType, LineBreakStrategy, LineCapStyle, LineJoinStyle, MarqueeUpdateStrategy, ModifierKey, MouseAction, MouseButton, NestedScrollMode, ObscuredReasons, OptionWidthMode, PageFlipMode, PixelRoundCalcPolicy, PixelRoundMode, Placement, PlayMode, RelateType, RenderFit, ResponseType, ScrollSource, TextAlign, SharedTransitionEffectType, TextOverflow, TextContentStyle, TextHeightAdaptivePolicy, WordBreak, TextCase, TextSelectableMode, TitleHeight, TouchType, TransitionType, VerticalAlign, Visibility, Week, WidthBreakpoint, XComponentType } from "./../enums" -import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild, Layoutable } from "./../common" +import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, Measurable, Layoutable, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, GeometryInfo, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild } from "./../common" import { Affinity, EllipsisMode, FontStyle, FontWidth, TextBox, LineMetrics, TextBaseline, TextDecorationStyle, TextDecorationType, TextDirection, FontFeature, FontVariation, RunMetrics, RectStyle, Decoration, TextShadow, text } from "./../arkui-graphics-text" import { AlphabetIndexerAttribute, Callback_Number_Void, OnAlphabetIndexerSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerPopupSelectCallback, IndexerAlign, Callback_Opt_Number_Void, AlphabetIndexerOptions } from "./../alphabet_indexer" import { ResourceColor, Font, Position, Length, SizeOptions, Offset, ColorFilter, ResourceStr, Dimension, LengthConstrain, VoidCallback, DividerStyleOptions, ConstraintSizeOptions, AccessibilityOptions, Bias, ChainWeightOptions, DirectionalEdgesT, EdgeOutlineStyles, VP, EdgeColors, LocalizedBorderRadiuses, LocalizedEdgeColors, LocalizedEdges, LocalizedEdgeWidths, LocalizedPadding, LocalizedPosition, BorderRadiuses, EdgeOutlineWidths, EdgeWidths, PX, LPX, MarkStyle, OutlineRadiuses, Padding, Area, BorderOptions, OutlineOptions } from "./../units" @@ -1111,6 +1111,9 @@ export class TypeChecker { static isGaugeShadowOptions(value: Object | string | number | undefined): boolean { return value instanceof GaugeShadowOptions } + static isGeometryInfo(value: Object | string | number | undefined, arg0: boolean, arg1: boolean, arg2: boolean): boolean { + return value instanceof GeometryInfo + } static isGeometryTransitionOptions(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { return value instanceof GeometryTransitionOptions } @@ -1402,6 +1405,9 @@ export class TypeChecker { static isLayeredDrawableDescriptor(value: Object | string | number | undefined): boolean { return value instanceof LayeredDrawableDescriptor } + static isLayoutable(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { + return value instanceof Layoutable + } static isLayoutDirection(value: Object | string | number | undefined): boolean { return value instanceof LayoutDirection } @@ -2791,6 +2797,9 @@ export class TypeChecker { static isSizeOptions(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { return value instanceof SizeOptions } + static isSizeResult(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { + return value instanceof SizeResult + } static isSizeType(value: Object | string | number | undefined): boolean { return value instanceof SizeType } @@ -5563,6 +5572,12 @@ export class TypeChecker { static isArray_TouchTestInfo(value: Object | string | number | undefined): boolean { return value instanceof Array } + static isArray_Measurable(value: Object | string | number | undefined): boolean { + return value instanceof Array + } + static isArray_Layoutable(value: Object | string | number | undefined): boolean { + return value instanceof Array + } static isArray_NavDestinationTransition(value: Object | string | number | undefined): boolean { return value instanceof Array } @@ -5674,12 +5689,6 @@ export class TypeChecker { static isArray_LayoutChild(value: Object | string | number | undefined): boolean { return value instanceof Array } - static isArray_Layoutable(value: Object | string | number | undefined): boolean { - return value instanceof Array - } - static isArray_Measurable(value: Object | string | number | undefined): boolean { - return value instanceof Array - } static isArray_Tuple_Union_ResourceColor_LinearGradient_Number(value: Object | string | number | undefined): boolean { return value instanceof Array<[ ResourceColor | LinearGradient, number ]> } diff --git a/arkoala-arkts/arkui/src/ets/generated/common.ets b/arkoala-arkts/arkui/src/ets/generated/common.ets index 9b6d55b3e..6b6b01e7c 100644 --- a/arkoala-arkts/arkui/src/ets/generated/common.ets +++ b/arkoala-arkts/arkui/src/ets/generated/common.ets @@ -28,7 +28,7 @@ import { UnifiedData, UnifiedDataInternal, ComponentContent, UIContext, Context, import { Summary, IntentionCode, EdgeStyles, CircleShape, EllipseShape, PathShape, RectShape, ImageModifier, SymbolGlyphModifier } from "./arkui-external" import { Callback_Void } from "./ability_component" import { KeyType, KeySource, Color, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Visibility, ItemAlign, Direction, ObscuredReasons, RenderFit, FocusDrawLevel, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, InteractionHand, GradientDirection, Curve, SharedTransitionEffectType, ArrowPointPosition, Placement, LineCapStyle, LineJoinStyle, BarState, CrownSensitivity, EdgeEffect, PlayMode, HorizontalAlign, VerticalAlign, TransitionType, FontWeight, TouchType, CrownAction, ClickEffectLevel, NestedScrollMode, PixelRoundCalcPolicy, IlluminatedType, MouseButton, MouseAction, AccessibilityHoverType, AxisAction, AxisModel } from "./enums" -import { ResourceColor, ConstraintSizeOptions, DirectionalEdgesT, SizeOptions, Length, ChainWeightOptions, Padding, LocalizedPadding, Position, BorderOptions, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, Bias, Font } from "./units" +import { ResourceColor, Position, DirectionalEdgesT, ConstraintSizeOptions, SizeOptions, Length, ChainWeightOptions, Padding, LocalizedPadding, BorderOptions, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, Bias, Font } from "./units" import { Resource } from "./resource" import { TextRange } from "./text_common" import { ComponentBase } from "./../ComponentBase" @@ -1270,6 +1270,122 @@ export class ProgressMask implements MaterializedBase { ArkUIGeneratedNativeModule._ProgressMask_enableBreathingAnimation(this.peer!.ptr, value ? 1 : 0) } } +export interface Layoutable { + measureResult: MeasureResult + uniqueId?: number | undefined + layout(position: Position): void + getMargin(): DirectionalEdgesT + getPadding(): DirectionalEdgesT + getBorderWidth(): DirectionalEdgesT +} +export class LayoutableInternal implements MaterializedBase,Layoutable { + peer?: Finalizable | undefined = undefined + public getPeer(): Finalizable | undefined { + return this.peer + } + get measureResult(): MeasureResult { + return this.getMeasureResult() + } + set measureResult(measureResult: MeasureResult) { + this.setMeasureResult(measureResult) + } + get uniqueId(): number | undefined { + return this.getUniqueId() + } + set uniqueId(uniqueId: number | undefined) { + const uniqueId_NonNull = (uniqueId as number) + this.setUniqueId(uniqueId_NonNull) + } + static ctor_layoutable(): KPointer { + const retval = ArkUIGeneratedNativeModule._Layoutable_ctor() + return retval + } + constructor() { + const ctorPtr : KPointer = LayoutableInternal.ctor_layoutable() + this.peer = new Finalizable(ctorPtr, LayoutableInternal.getFinalizer()) + } + static getFinalizer(): KPointer { + return ArkUIGeneratedNativeModule._Layoutable_getFinalizer() + } + public layout(position: Position): void { + const position_casted = position as (Position) + this.layout_serialize(position_casted) + return + } + public getMargin(): DirectionalEdgesT { + return this.getMargin_serialize() + } + public getPadding(): DirectionalEdgesT { + return this.getPadding_serialize() + } + public getBorderWidth(): DirectionalEdgesT { + return this.getBorderWidth_serialize() + } + private getMeasureResult(): MeasureResult { + return this.getMeasureResult_serialize() + } + private setMeasureResult(measureResult: MeasureResult): void { + const measureResult_casted = measureResult as (MeasureResult) + this.setMeasureResult_serialize(measureResult_casted) + return + } + private getUniqueId(): number | undefined { + return this.getUniqueId_serialize() + } + private setUniqueId(uniqueId: number): void { + const uniqueId_casted = uniqueId as (number) + this.setUniqueId_serialize(uniqueId_casted) + return + } + private layout_serialize(position: Position): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writePosition(position) + ArkUIGeneratedNativeModule._Layoutable_layout(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + private getMargin_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getMargin(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getPadding_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getPadding(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getBorderWidth_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getBorderWidth(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getMeasureResult_serialize(): MeasureResult { + const retval = ArkUIGeneratedNativeModule._Layoutable_getMeasureResult(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : MeasureResult = retvalDeserializer.readMeasureResult() + return returnResult + } + private setMeasureResult_serialize(measureResult: MeasureResult): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writeMeasureResult(measureResult) + ArkUIGeneratedNativeModule._Layoutable_setMeasureResult(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + private getUniqueId_serialize(): number | undefined { + const retval = ArkUIGeneratedNativeModule._Layoutable_getUniqueId(this.peer!.ptr) + throw new Error("Object deserialization is not implemented.") + } + private setUniqueId_serialize(uniqueId: number): void { + ArkUIGeneratedNativeModule._Layoutable_setUniqueId(this.peer!.ptr, uniqueId) + } + public static fromPtr(ptr: KPointer): LayoutableInternal { + const obj : LayoutableInternal = new LayoutableInternal() + obj.peer = new Finalizable(ptr, LayoutableInternal.getFinalizer()) + return obj + } +} export interface Measurable { uniqueId?: number | undefined measure(constraint: ConstraintSizeOptions): MeasureResult @@ -9897,9 +10013,6 @@ export interface GeometryInfo extends SizeResult { margin: Padding; padding: Padding; } -export interface Layoutable { - stub: string; -} export interface SizeResult { width: number; height: number; diff --git a/arkoala-arkts/arkui/src/ets/generated/generator_synthetic.ets b/arkoala-arkts/arkui/src/ets/generated/generator_synthetic.ets index 2ade216c7..b9faa18ed 100644 --- a/arkoala-arkts/arkui/src/ets/generated/generator_synthetic.ets +++ b/arkoala-arkts/arkui/src/ets/generated/generator_synthetic.ets @@ -20,8 +20,8 @@ import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { memo, memo_stable } from "@koalaui/runtime/annotations" import { BuilderLambda } from "@koalaui/builderLambda" +import { SizeResult, TouchResult, CustomBuilder, DragItemInfo } from "./common" import { GestureJudgeResult, GestureRecognizer } from "./gesture" -import { TouchResult, CustomBuilder, DragItemInfo } from "./common" import { HitTestMode } from "./enums" import { NavigationAnimatedTransition } from "./navigation" import { Tuple_Number_Number } from "./arkui-synthetics" @@ -34,6 +34,7 @@ import { WithThemeAttribute } from "./with_theme" import { WebKeyboardOptions, WebResourceResponse } from "./web" import { UserDataSpan, StyledString, CustomSpanMetrics } from "./styled_string" export type Callback_Pointer_Void = (value: KPointer) => void; +export type Callback_SizeResult_Void = (value: SizeResult) => void; export type Callback_Array_String_Void = (value: Array) => void; export type Callback_GestureJudgeResult_Void = (value: GestureJudgeResult) => void; export type Callback_GestureRecognizer_Void = (value: GestureRecognizer) => void; diff --git a/arkoala-arkts/arkui/src/ets/generated/peers/CallbackDeserializeCall.ets b/arkoala-arkts/arkui/src/ets/generated/peers/CallbackDeserializeCall.ets index 373b564b8..2de32ccb8 100644 --- a/arkoala-arkts/arkui/src/ets/generated/peers/CallbackDeserializeCall.ets +++ b/arkoala-arkts/arkui/src/ets/generated/peers/CallbackDeserializeCall.ets @@ -21,15 +21,15 @@ import { Deserializer } from "./Deserializer" import { int32, float32, int64 } from "@koalaui/common" import { ResourceHolder, KInt, KStringPtr, wrapSystemCallback, KPointer, RuntimeType, KSerializerBuffer, NativeBuffer } from "@koalaui/interop" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityHoverEvent, AccessibilityFocusCallback, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, Callback_AxisEvent_Void, AxisEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, Callback_ClickEvent_Void, ClickEvent, Callback_CrownEvent_Void, CrownEvent, CustomBuilder, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, ItemDragInfo, Callback_KeyEvent_Boolean, KeyEvent, Callback_KeyEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_MouseEvent_Void, MouseEvent, Callback_PreDragStatus_Void, PreDragStatus, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, SheetType, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, TouchEvent, Callback_TouchEvent_Void, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, PopupStateChangeParam, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback } from "./../common" +import { AccessibilityCallback, AccessibilityHoverEvent, AccessibilityFocusCallback, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, Callback_AxisEvent_Void, AxisEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, Callback_ClickEvent_Void, ClickEvent, Callback_CrownEvent_Void, CrownEvent, CustomBuilder, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, ItemDragInfo, Callback_KeyEvent_Boolean, KeyEvent, Callback_KeyEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_MouseEvent_Void, MouseEvent, GeometryInfo, Measurable, SizeResult, Layoutable, Callback_PreDragStatus_Void, PreDragStatus, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, SheetType, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, TouchEvent, Callback_TouchEvent_Void, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, PopupStateChangeParam, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback } from "./../common" import { AsyncCallback_Array_TextMenuItem_Array_TextMenuItem, TextMenuItem, AsyncCallback_TextMenuItem_TextRange_Boolean, TextRange, DeleteValue, EditableTextChangeValue, InsertValue, Callback_StyledStringChangeValue_Boolean, StyledStringChangeValue, EditableTextOnChangeCallback, PreviewText, TextChangeOptions, OnDidChangeCallback } from "./../text_common" import { AsyncCallback_CustomSpanMeasureInfo_CustomSpanMetrics, CustomSpanMeasureInfo, CustomSpanMetrics, Callback_DrawContext_CustomSpanDrawInfo_Void, CustomSpanDrawInfo, StyledString, UserDataSpan, StyledStringMarshallCallback, StyledStringUnmarshallCallback } from "./../styled_string" import { AsyncCallback_image_PixelMap_Void, ReceiveCallback } from "./../arkui-external" import { PixelMap } from "./../arkui-pixelmap" import { ButtonTriggerClickCallback } from "./../button" -import { Area, ResourceStr, SizeOptions, VoidCallback } from "./../units" +import { Area, ConstraintSizeOptions, ResourceStr, SizeOptions, VoidCallback } from "./../units" import { Callback_Array_Number_Void } from "./../pattern_lock" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_Boolean, Callback_NavDestinationActiveReason_Void, NavDestinationActiveReason, Callback_NavDestinationContext_Void, NavDestinationContext, Callback_Object_Void, NavDestinationTransition, NavDestinationTransitionDelegate } from "./../nav_destination" import { Callback_Boolean_Void, Callback_NavigationMode_Void, NavigationMode, Callback_NavigationTitleMode_Void, NavigationTitleMode, Callback_NavigationTransitionProxy_Void, NavigationTransitionProxy, NavigationAnimatedTransition, Callback_PopInfo_Void, PopInfo, Callback_String_Opt_Object_Void, InterceptionModeCallback, InterceptionShowCallback, NavBar, NavigationOperation, Type_NavigationAttribute_customNavContentTransition_delegate, NavContentInfo } from "./../navigation" import { Callback_CalendarRequestedData_Void, CalendarRequestedData, Callback_CalendarSelectedDate_Void, CalendarSelectedDate } from "./../calendar" @@ -58,6 +58,7 @@ import { Callback_Number_String_Void, Callback_Opt_ResourceStr_Void, Callback_Op import { Tuple_Number_Number } from "./../arkui-synthetics" import { Callback_Number_Void, Callback_Opt_Number_Void, OnAlphabetIndexerPopupSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerSelectCallback } from "./../alphabet_indexer" import { OffsetResult, OnScrollFrameBeginHandlerResult, OnScrollEdgeCallback, OnScrollFrameBeginCallback, ScrollOnScrollCallback, ScrollOnWillScrollCallback } from "./../scroll" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_Opt_Boolean_Void, OnCheckboxChangeCallback } from "./../checkbox" import { Resource } from "./../resource" import { TabContentAnimatedTransition, Callback_TabContentTransitionProxy_Void, TabContentTransitionProxy, OnTabsAnimationEndCallback, TabsAnimationEvent, OnTabsAnimationStartCallback, OnTabsContentWillChangeCallback, OnTabsGestureSwipeCallback, TabsCustomContentTransitionCallback } from "./../tabs" @@ -875,6 +876,21 @@ export function deserializeAndCallCallback_OnLoadInterceptEvent_Boolean(thisDese const _callResult = _call(parameter) _continuation(_callResult) } +export function deserializeAndCallCallback_onMeasureSize_SizeResult(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as Callback_onMeasureSize_SizeResult) + let selfLayoutInfo : GeometryInfo = thisDeserializer.readGeometryInfo() + const children_buf_length : int32 = thisDeserializer.readInt32() + let children_buf : Array = new Array(children_buf_length) + for (let children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf[children_buf_i] = (thisDeserializer.readMeasurable() as Measurable) + } + let children : Array = children_buf + let constraint : ConstraintSizeOptions = thisDeserializer.readConstraintSizeOptions() + let _continuation : ((value: SizeResult) => void) = thisDeserializer.readCallback_SizeResult_Void(true) + const _callResult = _call(selfLayoutInfo, children, constraint) + _continuation(_callResult) +} export function deserializeAndCallCallback_OnOverScrollEvent_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: OnOverScrollEvent) => void)) @@ -905,6 +921,19 @@ export function deserializeAndCallCallback_OnPermissionRequestEvent_Void(thisDes let parameter : OnPermissionRequestEvent = thisDeserializer.readOnPermissionRequestEvent() _call(parameter) } +export function deserializeAndCallCallback_onPlaceChildren_Void(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as Callback_onPlaceChildren_Void) + let selfLayoutInfo : GeometryInfo = thisDeserializer.readGeometryInfo() + const children_buf_length : int32 = thisDeserializer.readInt32() + let children_buf : Array = new Array(children_buf_length) + for (let children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf[children_buf_i] = (thisDeserializer.readLayoutable() as Layoutable) + } + let children : Array = children_buf + let constraint : ConstraintSizeOptions = thisDeserializer.readConstraintSizeOptions() + _call(selfLayoutInfo, children, constraint) +} export function deserializeAndCallCallback_OnProgressChangeEvent_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: OnProgressChangeEvent) => void)) @@ -1278,6 +1307,12 @@ export function deserializeAndCallCallback_SheetType_Void(thisDeserializer: Dese let parameter : SheetType = TypeChecker.SheetType_FromNumeric(thisDeserializer.readInt32()) _call(parameter) } +export function deserializeAndCallCallback_SizeResult_Void(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as ((value: SizeResult) => void)) + let value : SizeResult = thisDeserializer.readSizeResult() + _call(value) +} export function deserializeAndCallCallback_SpringBackAction_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: SpringBackAction) => void)) @@ -2607,11 +2642,13 @@ export function deserializeAndCallCallback(thisDeserializer: Deserializer): void case -2066745559/*CallbackKind.Kind_Callback_OnHttpErrorReceiveEvent_Void*/: return deserializeAndCallCallback_OnHttpErrorReceiveEvent_Void(thisDeserializer); case 1442698200/*CallbackKind.Kind_Callback_OnInterceptRequestEvent_WebResourceResponse*/: return deserializeAndCallCallback_OnInterceptRequestEvent_WebResourceResponse(thisDeserializer); case 1231444306/*CallbackKind.Kind_Callback_OnLoadInterceptEvent_Boolean*/: return deserializeAndCallCallback_OnLoadInterceptEvent_Boolean(thisDeserializer); + case -1356285653/*CallbackKind.Kind_Callback_onMeasureSize_SizeResult*/: return deserializeAndCallCallback_onMeasureSize_SizeResult(thisDeserializer); case -860386431/*CallbackKind.Kind_Callback_OnOverScrollEvent_Void*/: return deserializeAndCallCallback_OnOverScrollEvent_Void(thisDeserializer); case -2040193994/*CallbackKind.Kind_Callback_OnPageBeginEvent_Void*/: return deserializeAndCallCallback_OnPageBeginEvent_Void(thisDeserializer); case -130135362/*CallbackKind.Kind_Callback_OnPageEndEvent_Void*/: return deserializeAndCallCallback_OnPageEndEvent_Void(thisDeserializer); case 1805946367/*CallbackKind.Kind_Callback_OnPageVisibleEvent_Void*/: return deserializeAndCallCallback_OnPageVisibleEvent_Void(thisDeserializer); case 529980696/*CallbackKind.Kind_Callback_OnPermissionRequestEvent_Void*/: return deserializeAndCallCallback_OnPermissionRequestEvent_Void(thisDeserializer); + case -738620506/*CallbackKind.Kind_Callback_onPlaceChildren_Void*/: return deserializeAndCallCallback_onPlaceChildren_Void(thisDeserializer); case 1018740377/*CallbackKind.Kind_Callback_OnProgressChangeEvent_Void*/: return deserializeAndCallCallback_OnProgressChangeEvent_Void(thisDeserializer); case -1826742986/*CallbackKind.Kind_Callback_OnPromptEvent_Boolean*/: return deserializeAndCallCallback_OnPromptEvent_Boolean(thisDeserializer); case 1978364344/*CallbackKind.Kind_Callback_OnRefreshAccessedHistoryEvent_Void*/: return deserializeAndCallCallback_OnRefreshAccessedHistoryEvent_Void(thisDeserializer); @@ -2653,6 +2690,7 @@ export function deserializeAndCallCallback(thisDeserializer: Deserializer): void case 1980824326/*CallbackKind.Kind_Callback_RichEditorTextSpanResult_Void*/: return deserializeAndCallCallback_RichEditorTextSpanResult_Void(thisDeserializer); case 22609082/*CallbackKind.Kind_Callback_SheetDismiss_Void*/: return deserializeAndCallCallback_SheetDismiss_Void(thisDeserializer); case -224451112/*CallbackKind.Kind_Callback_SheetType_Void*/: return deserializeAndCallCallback_SheetType_Void(thisDeserializer); + case 1318865891/*CallbackKind.Kind_Callback_SizeResult_Void*/: return deserializeAndCallCallback_SizeResult_Void(thisDeserializer); case 1536231691/*CallbackKind.Kind_Callback_SpringBackAction_Void*/: return deserializeAndCallCallback_SpringBackAction_Void(thisDeserializer); case -879490874/*CallbackKind.Kind_Callback_String_Number_Void*/: return deserializeAndCallCallback_String_Number_Void(thisDeserializer); case -716524508/*CallbackKind.Kind_Callback_String_Opt_Object_Void*/: return deserializeAndCallCallback_String_Opt_Object_Void(thisDeserializer); diff --git a/arkoala-arkts/arkui/src/ets/generated/peers/CallbackKind.ets b/arkoala-arkts/arkui/src/ets/generated/peers/CallbackKind.ets index f92e54d00..cb9024e1b 100644 --- a/arkoala-arkts/arkui/src/ets/generated/peers/CallbackKind.ets +++ b/arkoala-arkts/arkui/src/ets/generated/peers/CallbackKind.ets @@ -106,11 +106,13 @@ export enum CallbackKind { Kind_Callback_OnHttpErrorReceiveEvent_Void = -2066745559, Kind_Callback_OnInterceptRequestEvent_WebResourceResponse = 1442698200, Kind_Callback_OnLoadInterceptEvent_Boolean = 1231444306, + Kind_Callback_onMeasureSize_SizeResult = -1356285653, Kind_Callback_OnOverScrollEvent_Void = -860386431, Kind_Callback_OnPageBeginEvent_Void = -2040193994, Kind_Callback_OnPageEndEvent_Void = -130135362, Kind_Callback_OnPageVisibleEvent_Void = 1805946367, Kind_Callback_OnPermissionRequestEvent_Void = 529980696, + Kind_Callback_onPlaceChildren_Void = -738620506, Kind_Callback_OnProgressChangeEvent_Void = 1018740377, Kind_Callback_OnPromptEvent_Boolean = -1826742986, Kind_Callback_OnRefreshAccessedHistoryEvent_Void = 1978364344, @@ -152,6 +154,7 @@ export enum CallbackKind { Kind_Callback_RichEditorTextSpanResult_Void = 1980824326, Kind_Callback_SheetDismiss_Void = 22609082, Kind_Callback_SheetType_Void = -224451112, + Kind_Callback_SizeResult_Void = 1318865891, Kind_Callback_SpringBackAction_Void = 1536231691, Kind_Callback_String_Number_Void = -879490874, Kind_Callback_String_Opt_Object_Void = -716524508, diff --git a/arkoala-arkts/arkui/src/ets/generated/peers/Deserializer.ets b/arkoala-arkts/arkui/src/ets/generated/peers/Deserializer.ets index 42990c7d7..163b4cfd3 100644 --- a/arkoala-arkts/arkui/src/ets/generated/peers/Deserializer.ets +++ b/arkoala-arkts/arkui/src/ets/generated/peers/Deserializer.ets @@ -22,9 +22,10 @@ import { CallbackKind } from "./CallbackKind" import { Serializer } from "./Serializer" import { TypeChecker } from "#components" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasurableInternal, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" +import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, GeometryInfo, Measurable, MeasurableInternal, Layoutable, LayoutableInternal, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, ControlSize, ButtonOptions } from "./../button" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../animation_extender" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_RangeUpdate, Context_getGroupDir_Callback, RestrictedWorker_onerror_Callback, RestrictedWorker_onexit_Callback, RestrictedWorker_onmessage_Callback, ComponentContent, ComponentContentInternal, UnifiedData, UnifiedDataInternal, UIContext, UIContextInternal, SystemBarStyle, PointerStyle, Scene, SceneInternal, Context, ContextInternal, WorkerEventListener, WorkerEventListenerInternal, Event, ErrorEvent, MessageEvents, BaseContext, BaseContextInternal, PostMessageOptions, WorkerOptions, CustomColors, RestrictedWorker, RestrictedWorkerInternal, CustomTheme } from "./../arkui-custom" import { ContentDidScrollCallback, ContentWillScrollCallback, OnSwiperAnimationEndCallback, OnSwiperAnimationStartCallback, OnSwiperGestureSwipeCallback, SwiperAnimationEvent, SwiperAnimationMode, SwiperAttribute, DotIndicator, DigitIndicator, SwiperDisplayMode, SwiperNestedScrollMode, SwiperContentAnimatedTransition, SwiperContentWillScrollResult, AutoPlayOptions, ArrowStyle, SwiperAutoFill, SwiperContentTransitionProxy, SwiperContentTransitionProxyInternal, SwiperController, SwiperControllerInternal, Callback_SwiperContentTransitionProxy_Void, Indicator } from "./../swiper" import { CustomNodeBuilder } from "./../custom_builder" @@ -133,7 +134,7 @@ import { TextTimerController, TextTimerControllerInternal, TextTimerOptions } fr import { ToggleType, ToggleOptions, SwitchStyle } from "./../toggle" import { UniformDataType } from "./../arkui-uniformtypedescriptor" import { WindowSceneAttribute } from "./../window_scene" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_DismissDialogAction_Void, DismissDialogAction, ImmersiveMode, LevelMode, ActionSheetButtonOptions, ActionSheetOffset, SheetInfo, ActionSheetOptions } from "./../action_sheet" import { Want } from "./../ohos.app.ability" import { Callback_TerminationInfo_Void, TerminationInfo } from "./../embedded_component" @@ -852,6 +853,13 @@ export class Deserializer extends DeserializerBase { let value : Size = ({width: width_result, height: height_result} as Size) return value } + public readSizeResult(): SizeResult { + let valueDeserializer : Deserializer = this + const width_result : number = (valueDeserializer.readNumber() as number) + const height_result : number = (valueDeserializer.readNumber() as number) + let value : SizeResult = ({width: width_result, height: height_result} as SizeResult) + return value + } public readSliderAttribute(): SliderAttribute { throw new Error("Interface with functions is not supported") } @@ -2860,6 +2868,29 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return (_continuationValue as boolean); } } + public readCallback_onMeasureSize_SizeResult(isSync: boolean = false): Callback_onMeasureSize_SizeResult { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions):SizeResult => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeGeometryInfo(selfLayoutInfo); + _argsSerializer.writeInt32(children.length as int32); + for (let i = 0; i < children.length; i++) { + const children_element : Measurable = children[i]; + _argsSerializer.writeMeasurable(children_element); + } + _argsSerializer.writeConstraintSizeOptions(constraint); + let _continuationValue : SizeResult | undefined; + const _continuationCallback : ((value: SizeResult) => void) = (value: SizeResult):void => { _continuationValue = value; } + _argsSerializer.holdAndWriteCallback(_continuationCallback); + (isSync) ? (InteropNativeModule._CallCallbackSync(-1356285653, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(-1356285653, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return (_continuationValue as SizeResult); } + } public readCallback_OnOverScrollEvent_Void(isSync: boolean = false): ((parameter: OnOverScrollEvent) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -2930,6 +2961,26 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return; } } + public readCallback_onPlaceChildren_Void(isSync: boolean = false): Callback_onPlaceChildren_Void { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions):void => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeGeometryInfo(selfLayoutInfo); + _argsSerializer.writeInt32(children.length as int32); + for (let i = 0; i < children.length; i++) { + const children_element : Layoutable = children[i]; + _argsSerializer.writeLayoutable(children_element); + } + _argsSerializer.writeConstraintSizeOptions(constraint); + (isSync) ? (InteropNativeModule._CallCallbackSync(-738620506, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(-738620506, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return; } + } public readCallback_OnProgressChangeEvent_Void(isSync: boolean = false): ((parameter: OnProgressChangeEvent) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -3633,6 +3684,20 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return; } } + public readCallback_SizeResult_Void(isSync: boolean = false): ((value: SizeResult) => void) { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (value: SizeResult):void => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeSizeResult(value); + (isSync) ? (InteropNativeModule._CallCallbackSync(1318865891, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(1318865891, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return; } + } public readCallback_SpringBackAction_Void(isSync: boolean = false): ((parameter: SpringBackAction) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -14719,6 +14784,11 @@ export class Deserializer extends DeserializerBase { let value : JavaScriptProxy = ({object_: object__result, name: name_result, methodList: methodList_result, controller: controller_result, asyncMethodList: asyncMethodList_result, permission: permission_result} as JavaScriptProxy) return value } + public readLayoutable(): Layoutable { + let valueDeserializer : Deserializer = this + let ptr : KPointer = valueDeserializer.readPointer() + return LayoutableInternal.fromPtr(ptr) + } public readLengthConstrain(): LengthConstrain { let valueDeserializer : Deserializer = this const minLength_buf_selector : int32 = valueDeserializer.readInt8() @@ -25560,6 +25630,100 @@ export class Deserializer extends DeserializerBase { let ptr : KPointer = valueDeserializer.readPointer() return FocusAxisEventInternal.fromPtr(ptr) } + public readGeometryInfo(): GeometryInfo { + let valueDeserializer : Deserializer = this + const width_result : number = (valueDeserializer.readNumber() as number) + const height_result : number = (valueDeserializer.readNumber() as number) + const borderWidth_result : EdgeWidths = valueDeserializer.readEdgeWidths() + const margin_result : Padding = valueDeserializer.readPadding() + const padding_buf_top_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_top_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_top_buf_runtimeType)) + { + const padding_buf_top_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_top_buf_ : string | number | Resource | undefined + if (padding_buf_top_buf__selector == 0) { + padding_buf_top_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_top_buf__selector == 1) { + padding_buf_top_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_top_buf__selector == 2) { + padding_buf_top_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_top_buf_ has to be chosen through deserialisation.") + } + padding_buf_top_buf = (padding_buf_top_buf_ as string | number | Resource) + } + const padding_buf_top : undefined | Length = padding_buf_top_buf + const padding_buf_right_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_right_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_right_buf_runtimeType)) + { + const padding_buf_right_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_right_buf_ : string | number | Resource | undefined + if (padding_buf_right_buf__selector == 0) { + padding_buf_right_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_right_buf__selector == 1) { + padding_buf_right_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_right_buf__selector == 2) { + padding_buf_right_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_right_buf_ has to be chosen through deserialisation.") + } + padding_buf_right_buf = (padding_buf_right_buf_ as string | number | Resource) + } + const padding_buf_right : undefined | Length = padding_buf_right_buf + const padding_buf_bottom_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_bottom_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_bottom_buf_runtimeType)) + { + const padding_buf_bottom_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_bottom_buf_ : string | number | Resource | undefined + if (padding_buf_bottom_buf__selector == 0) { + padding_buf_bottom_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_bottom_buf__selector == 1) { + padding_buf_bottom_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_bottom_buf__selector == 2) { + padding_buf_bottom_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_bottom_buf_ has to be chosen through deserialisation.") + } + padding_buf_bottom_buf = (padding_buf_bottom_buf_ as string | number | Resource) + } + const padding_buf_bottom : undefined | Length = padding_buf_bottom_buf + const padding_buf_left_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_left_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_left_buf_runtimeType)) + { + const padding_buf_left_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_left_buf_ : string | number | Resource | undefined + if (padding_buf_left_buf__selector == 0) { + padding_buf_left_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_left_buf__selector == 1) { + padding_buf_left_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_left_buf__selector == 2) { + padding_buf_left_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_left_buf_ has to be chosen through deserialisation.") + } + padding_buf_left_buf = (padding_buf_left_buf_ as string | number | Resource) + } + const padding_buf_left : undefined | Length = padding_buf_left_buf + const padding_result : Padding = ({top: padding_buf_top, right: padding_buf_right, bottom: padding_buf_bottom, left: padding_buf_left} as Padding) + let value : GeometryInfo = ({width: width_result, height: height_result, borderWidth: borderWidth_result, margin: margin_result, padding: padding_result} as GeometryInfo) + return value + } public readGestureEvent(): GestureEvent { let valueDeserializer : Deserializer = this let ptr : KPointer = valueDeserializer.readPointer() diff --git a/arkoala-arkts/arkui/src/ets/generated/peers/Serializer.ets b/arkoala-arkts/arkui/src/ets/generated/peers/Serializer.ets index ec48b662a..6819bc599 100644 --- a/arkoala-arkts/arkui/src/ets/generated/peers/Serializer.ets +++ b/arkoala-arkts/arkui/src/ets/generated/peers/Serializer.ets @@ -21,9 +21,10 @@ import { int32, int64, float32, unsafeCast } from "@koalaui/common" import { CallbackKind } from "./CallbackKind" import { TypeChecker } from "#components" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasurableInternal, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" +import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, GeometryInfo, Measurable, MeasurableInternal, Layoutable, LayoutableInternal, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, ControlSize, ButtonOptions } from "./../button" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../animation_extender" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_RangeUpdate, Context_getGroupDir_Callback, RestrictedWorker_onerror_Callback, RestrictedWorker_onexit_Callback, RestrictedWorker_onmessage_Callback, ComponentContent, ComponentContentInternal, UnifiedData, UnifiedDataInternal, UIContext, UIContextInternal, SystemBarStyle, PointerStyle, Scene, SceneInternal, Context, ContextInternal, WorkerEventListener, WorkerEventListenerInternal, Event, ErrorEvent, MessageEvents, BaseContext, BaseContextInternal, PostMessageOptions, WorkerOptions, CustomColors, RestrictedWorker, RestrictedWorkerInternal, CustomTheme } from "./../arkui-custom" import { ContentDidScrollCallback, ContentWillScrollCallback, OnSwiperAnimationEndCallback, OnSwiperAnimationStartCallback, OnSwiperGestureSwipeCallback, SwiperAnimationEvent, SwiperAnimationMode, SwiperAttribute, DotIndicator, DigitIndicator, SwiperDisplayMode, SwiperNestedScrollMode, SwiperContentAnimatedTransition, SwiperContentWillScrollResult, AutoPlayOptions, ArrowStyle, SwiperAutoFill, SwiperContentTransitionProxy, SwiperContentTransitionProxyInternal, SwiperController, SwiperControllerInternal, Callback_SwiperContentTransitionProxy_Void, Indicator } from "./../swiper" import { CustomNodeBuilder } from "./../custom_builder" @@ -132,7 +133,7 @@ import { TextTimerController, TextTimerControllerInternal, TextTimerOptions } fr import { ToggleType, ToggleOptions, SwitchStyle } from "./../toggle" import { UniformDataType } from "./../arkui-uniformtypedescriptor" import { WindowSceneAttribute } from "./../window_scene" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_DismissDialogAction_Void, DismissDialogAction, ImmersiveMode, LevelMode, ActionSheetButtonOptions, ActionSheetOffset, SheetInfo, ActionSheetOptions } from "./../action_sheet" import { Want } from "./../ohos.app.ability" import { Callback_TerminationInfo_Void, TerminationInfo } from "./../embedded_component" @@ -758,6 +759,13 @@ export class Serializer extends SerializerBase { const value_height = value.height valueSerializer.writeNumber(value_height) } + public writeSizeResult(value: SizeResult): void { + let valueSerializer : Serializer = this + const value_width = value.width + valueSerializer.writeNumber(value_width) + const value_height = value.height + valueSerializer.writeNumber(value_height) + } public writeSliderAttribute(value: SliderAttribute): void { } public writeSpringMotion(value: SpringMotion): void { @@ -10571,6 +10579,10 @@ export class Serializer extends SerializerBase { valueSerializer.writeString(value_permission_value) } } + public writeLayoutable(value: Layoutable): void { + let valueSerializer : Serializer = this + valueSerializer.writePointer(toPeerPtr(value)) + } public writeLengthConstrain(value: LengthConstrain): void { let valueSerializer : Serializer = this const value_minLength = value.minLength @@ -23012,6 +23024,114 @@ export class Serializer extends SerializerBase { let valueSerializer : Serializer = this valueSerializer.writePointer(toPeerPtr(value)) } + public writeGeometryInfo(value: GeometryInfo): void { + let valueSerializer : Serializer = this + const value_width = value.width + valueSerializer.writeNumber(value_width) + const value_height = value.height + valueSerializer.writeNumber(value_height) + const value_borderWidth = value.borderWidth + valueSerializer.writeEdgeWidths(value_borderWidth) + const value_margin = value.margin + valueSerializer.writePadding(value_margin) + const value_padding = value.padding + const value_padding_top = value_padding.top + let value_padding_top_type : int32 = RuntimeType.UNDEFINED + value_padding_top_type = runtimeType(value_padding_top) + valueSerializer.writeInt8(value_padding_top_type) + if ((RuntimeType.UNDEFINED) != (value_padding_top_type)) { + const value_padding_top_value = value_padding_top! + let value_padding_top_value_type : int32 = RuntimeType.UNDEFINED + value_padding_top_value_type = runtimeType(value_padding_top_value) + if (RuntimeType.STRING == value_padding_top_value_type) { + valueSerializer.writeInt8(0) + const value_padding_top_value_0 = value_padding_top_value as string + valueSerializer.writeString(value_padding_top_value_0) + } + else if (RuntimeType.NUMBER == value_padding_top_value_type) { + valueSerializer.writeInt8(1) + const value_padding_top_value_1 = value_padding_top_value as number + valueSerializer.writeNumber(value_padding_top_value_1) + } + else if (RuntimeType.OBJECT == value_padding_top_value_type) { + valueSerializer.writeInt8(2) + const value_padding_top_value_2 = value_padding_top_value as Resource + valueSerializer.writeResource(value_padding_top_value_2) + } + } + const value_padding_right = value_padding.right + let value_padding_right_type : int32 = RuntimeType.UNDEFINED + value_padding_right_type = runtimeType(value_padding_right) + valueSerializer.writeInt8(value_padding_right_type) + if ((RuntimeType.UNDEFINED) != (value_padding_right_type)) { + const value_padding_right_value = value_padding_right! + let value_padding_right_value_type : int32 = RuntimeType.UNDEFINED + value_padding_right_value_type = runtimeType(value_padding_right_value) + if (RuntimeType.STRING == value_padding_right_value_type) { + valueSerializer.writeInt8(0) + const value_padding_right_value_0 = value_padding_right_value as string + valueSerializer.writeString(value_padding_right_value_0) + } + else if (RuntimeType.NUMBER == value_padding_right_value_type) { + valueSerializer.writeInt8(1) + const value_padding_right_value_1 = value_padding_right_value as number + valueSerializer.writeNumber(value_padding_right_value_1) + } + else if (RuntimeType.OBJECT == value_padding_right_value_type) { + valueSerializer.writeInt8(2) + const value_padding_right_value_2 = value_padding_right_value as Resource + valueSerializer.writeResource(value_padding_right_value_2) + } + } + const value_padding_bottom = value_padding.bottom + let value_padding_bottom_type : int32 = RuntimeType.UNDEFINED + value_padding_bottom_type = runtimeType(value_padding_bottom) + valueSerializer.writeInt8(value_padding_bottom_type) + if ((RuntimeType.UNDEFINED) != (value_padding_bottom_type)) { + const value_padding_bottom_value = value_padding_bottom! + let value_padding_bottom_value_type : int32 = RuntimeType.UNDEFINED + value_padding_bottom_value_type = runtimeType(value_padding_bottom_value) + if (RuntimeType.STRING == value_padding_bottom_value_type) { + valueSerializer.writeInt8(0) + const value_padding_bottom_value_0 = value_padding_bottom_value as string + valueSerializer.writeString(value_padding_bottom_value_0) + } + else if (RuntimeType.NUMBER == value_padding_bottom_value_type) { + valueSerializer.writeInt8(1) + const value_padding_bottom_value_1 = value_padding_bottom_value as number + valueSerializer.writeNumber(value_padding_bottom_value_1) + } + else if (RuntimeType.OBJECT == value_padding_bottom_value_type) { + valueSerializer.writeInt8(2) + const value_padding_bottom_value_2 = value_padding_bottom_value as Resource + valueSerializer.writeResource(value_padding_bottom_value_2) + } + } + const value_padding_left = value_padding.left + let value_padding_left_type : int32 = RuntimeType.UNDEFINED + value_padding_left_type = runtimeType(value_padding_left) + valueSerializer.writeInt8(value_padding_left_type) + if ((RuntimeType.UNDEFINED) != (value_padding_left_type)) { + const value_padding_left_value = value_padding_left! + let value_padding_left_value_type : int32 = RuntimeType.UNDEFINED + value_padding_left_value_type = runtimeType(value_padding_left_value) + if (RuntimeType.STRING == value_padding_left_value_type) { + valueSerializer.writeInt8(0) + const value_padding_left_value_0 = value_padding_left_value as string + valueSerializer.writeString(value_padding_left_value_0) + } + else if (RuntimeType.NUMBER == value_padding_left_value_type) { + valueSerializer.writeInt8(1) + const value_padding_left_value_1 = value_padding_left_value as number + valueSerializer.writeNumber(value_padding_left_value_1) + } + else if (RuntimeType.OBJECT == value_padding_left_value_type) { + valueSerializer.writeInt8(2) + const value_padding_left_value_2 = value_padding_left_value as Resource + valueSerializer.writeResource(value_padding_left_value_2) + } + } + } public writeGestureEvent(value: GestureEvent): void { let valueSerializer : Serializer = this valueSerializer.writePointer(toPeerPtr(value)) diff --git a/arkoala-arkts/arkui/src/ets/generated/static_components.ets b/arkoala-arkts/arkui/src/ets/generated/static_components.ets index 1cf3a27e9..8d8b49f82 100644 --- a/arkoala-arkts/arkui/src/ets/generated/static_components.ets +++ b/arkoala-arkts/arkui/src/ets/generated/static_components.ets @@ -24,6 +24,8 @@ import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./../CallbackTransformer" +import { GeometryInfo, Measurable, Layoutable, SizeResult } from "./common" +import { ConstraintSizeOptions } from "./units" import { memo, memo_stable } from "@koalaui/runtime/annotations" import { BuilderLambda } from "@koalaui/builderLambda" import { UICommonBase, AttributeModifier } from "./../handwritten" @@ -52,6 +54,30 @@ export class ArkComponentRootPeer extends PeerNode { return _peer } } +export class ArkCustomLayoutRootPeer extends PeerNode { + protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { + super(peerPtr, id, name, flags) + } + public static create(component?: ComponentBase, flags: int32 = 0): ArkCustomLayoutRootPeer { + const peerId = PeerNode.nextId() + const _peerPtr = ArkUIGeneratedNativeModule._CustomLayoutRoot_construct(peerId, flags) + const _peer = new ArkCustomLayoutRootPeer(_peerPtr, peerId, "CustomLayoutRoot", flags) + component?.setPeer(_peer) + return _peer + } + subscribeOnMeasureSizeAttribute(value: Callback_onMeasureSize_SizeResult): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + ArkUIGeneratedNativeModule._CustomLayoutRoot_subscribeOnMeasureSize(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + subscribeOnPlaceChildrenAttribute(value: Callback_onPlaceChildren_Void): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + ArkUIGeneratedNativeModule._CustomLayoutRoot_subscribeOnPlaceChildren(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } +} export interface Root { attributeModifier(value: AttributeModifier | undefined): this } @@ -76,6 +102,34 @@ export class ArkComponentRootStyle implements ComponentRoot { throw new Error("Not implemented") } } +export type Callback_onMeasureSize_SizeResult = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => SizeResult; +export type Callback_onPlaceChildren_Void = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => void; +export interface CustomLayoutRoot { + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + attributeModifier(value: AttributeModifier | undefined): this +} +export interface UICustomLayoutRoot { + @memo + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + @memo + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + @memo + attributeModifier(value: AttributeModifier | undefined): this +} +export class ArkCustomLayoutRootStyle implements CustomLayoutRoot { + subscribeOnMeasureSize_value?: Callback_onMeasureSize_SizeResult + subscribeOnPlaceChildren_value?: Callback_onPlaceChildren_Void + public subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this { + return this + } + public subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this { + return this + } + public attributeModifier(value: AttributeModifier | undefined): this { + throw new Error("Not implemented") + } +} @memo_stable export class ArkRootComponent extends ComponentBase implements UIRoot { getPeer(): ArkRootPeer { @@ -106,3 +160,36 @@ export class ArkComponentRootComponent extends ComponentBase implements UICompon super.applyAttributesFinish() } } +@memo_stable +export class ArkCustomLayoutRootComponent extends ComponentBase implements UICustomLayoutRoot { + getPeer(): ArkCustomLayoutRootPeer { + return (this.peer as ArkCustomLayoutRootPeer) + } + @memo + public subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this { + if (this.checkPriority("subscribeOnMeasureSize")) { + const value_casted = value as (Callback_onMeasureSize_SizeResult) + this.getPeer()?.subscribeOnMeasureSizeAttribute(value_casted) + return this + } + return this + } + @memo + public subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this { + if (this.checkPriority("subscribeOnPlaceChildren")) { + const value_casted = value as (Callback_onPlaceChildren_Void) + this.getPeer()?.subscribeOnPlaceChildrenAttribute(value_casted) + return this + } + return this + } + @memo + public attributeModifier(value: AttributeModifier | undefined): this { + console.log("attributeModifier() not implemented") + return this + } + public applyAttributesFinish(): void { + // we call this function outside of class, so need to make it public + super.applyAttributesFinish() + } +} diff --git a/arkoala-arkts/arkui/src/ets/generated/ts/type_check.ets b/arkoala-arkts/arkui/src/ets/generated/ts/type_check.ets index f400b7e4f..a77103e95 100644 --- a/arkoala-arkts/arkui/src/ets/generated/ts/type_check.ets +++ b/arkoala-arkts/arkui/src/ets/generated/ts/type_check.ets @@ -19,7 +19,7 @@ import { KBoolean, KStringPtr, NativeBuffer, MaterializedBase } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { AccessibilityHoverType, Alignment, AnimationStatus, AppRotation, ArrowPointPosition, Axis, AxisAction, AxisModel, BarState, BorderStyle, CheckBoxShape, ClickEffectLevel, Color, ColoringStrategy, CopyOptions, CrownAction, CrownSensitivity, Curve, DialogButtonStyle, Direction, DividerMode, Edge, EdgeEffect, EmbeddedType, FillMode, FlexAlign, FlexDirection, FlexWrap, FocusDrawLevel, FoldStatus, FontWeight, FunctionKey, GradientDirection, HeightBreakpoint, HitTestMode, HorizontalAlign, HoverEffect, IlluminatedType, ImageFit, ImageRepeat, ImageSize, ImageSpanAlignment, InteractionHand, ItemAlign, KeySource, KeyType, LineBreakStrategy, LineCapStyle, LineJoinStyle, MarqueeUpdateStrategy, ModifierKey, MouseAction, MouseButton, NestedScrollMode, ObscuredReasons, OptionWidthMode, PageFlipMode, PixelRoundCalcPolicy, PixelRoundMode, Placement, PlayMode, RelateType, RenderFit, ResponseType, ScrollSource, TextAlign, SharedTransitionEffectType, TextOverflow, TextContentStyle, TextHeightAdaptivePolicy, WordBreak, TextCase, TextSelectableMode, TitleHeight, TouchType, TransitionType, VerticalAlign, Visibility, Week, WidthBreakpoint, XComponentType } from "./../enums" -import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild, Layoutable } from "./../common" +import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, Measurable, Layoutable, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, GeometryInfo, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild } from "./../common" import { Affinity, EllipsisMode, FontStyle, FontWidth, TextBox, LineMetrics, TextBaseline, TextDecorationStyle, TextDecorationType, TextDirection, FontFeature, FontVariation, RunMetrics, RectStyle, Decoration, TextShadow, text } from "./../arkui-graphics-text" import { AlphabetIndexerAttribute, Callback_Number_Void, OnAlphabetIndexerSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerPopupSelectCallback, IndexerAlign, Callback_Opt_Number_Void, AlphabetIndexerOptions } from "./../alphabet_indexer" import { ResourceColor, Font, Position, Length, SizeOptions, Offset, ColorFilter, ResourceStr, Dimension, LengthConstrain, VoidCallback, DividerStyleOptions, ConstraintSizeOptions, AccessibilityOptions, Bias, ChainWeightOptions, DirectionalEdgesT, EdgeOutlineStyles, VP, EdgeColors, LocalizedBorderRadiuses, LocalizedEdgeColors, LocalizedEdges, LocalizedEdgeWidths, LocalizedPadding, LocalizedPosition, BorderRadiuses, EdgeOutlineWidths, EdgeWidths, PX, LPX, MarkStyle, OutlineRadiuses, Padding, Area, BorderOptions, OutlineOptions } from "./../units" @@ -5981,6 +5981,20 @@ export class TypeChecker { static isGaugeShadowOptions(value: Object | string | number | undefined | boolean): boolean { throw new Error("Can not discriminate value typeof GaugeShadowOptions") } + static isGeometryInfo(value: Object | string | number | undefined | boolean, duplicated_borderWidth: boolean, duplicated_margin: boolean, duplicated_padding: boolean): boolean { + if ((!duplicated_borderWidth) && (value?.hasOwnProperty("borderWidth"))) { + return true + } + else if ((!duplicated_margin) && (value?.hasOwnProperty("margin"))) { + return true + } + else if ((!duplicated_padding) && (value?.hasOwnProperty("padding"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof GeometryInfo") + } + } static isGeometryTransitionOptions(value: Object | string | number | undefined | boolean, duplicated_follow: boolean, duplicated_hierarchyStrategy: boolean): boolean { if ((!duplicated_follow) && (value?.hasOwnProperty("follow"))) { return true @@ -7609,6 +7623,17 @@ export class TypeChecker { static isLayeredDrawableDescriptor(value: Object | string | number | undefined | boolean): boolean { throw new Error("Can not discriminate value typeof LayeredDrawableDescriptor") } + static isLayoutable(value: Object | string | number | undefined | boolean, duplicated_measureResult: boolean, duplicated_uniqueId: boolean): boolean { + if ((!duplicated_measureResult) && (value?.hasOwnProperty("measureResult"))) { + return true + } + else if ((!duplicated_uniqueId) && (value?.hasOwnProperty("uniqueId"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof Layoutable") + } + } static isLayoutDirection(value: Object | string | number | undefined | boolean): boolean { if ((value) === (LayoutDirection.LTR)) { return true @@ -14737,6 +14762,17 @@ export class TypeChecker { throw new Error("Can not discriminate value typeof SizeOptions") } } + static isSizeResult(value: Object | string | number | undefined | boolean, duplicated_width: boolean, duplicated_height: boolean): boolean { + if ((!duplicated_width) && (value?.hasOwnProperty("width"))) { + return true + } + else if ((!duplicated_height) && (value?.hasOwnProperty("height"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof SizeResult") + } + } static isSizeType(value: Object | string | number | undefined | boolean): boolean { if ((value) === (SizeType.Auto)) { return true @@ -21710,6 +21746,12 @@ export class TypeChecker { static isArray_TouchTestInfo(value: Object | string | number | undefined): boolean { return Array.isArray(value) } + static isArray_Measurable(value: Object | string | number | undefined): boolean { + return Array.isArray(value) + } + static isArray_Layoutable(value: Object | string | number | undefined): boolean { + return Array.isArray(value) + } static isArray_NavDestinationTransition(value: Object | string | number | undefined): boolean { return Array.isArray(value) } @@ -21821,12 +21863,6 @@ export class TypeChecker { static isArray_LayoutChild(value: Object | string | number | undefined): boolean { return Array.isArray(value) } - static isArray_Layoutable(value: Object | string | number | undefined): boolean { - return Array.isArray(value) - } - static isArray_Measurable(value: Object | string | number | undefined): boolean { - return Array.isArray(value) - } static isArray_Tuple_Union_ResourceColor_LinearGradient_Number(value: Object | string | number | undefined): boolean { return Array.isArray(value) } diff --git a/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts b/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts index fbed26f85..3861c15ff 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/ArkUIGeneratedNativeModule.ts @@ -28,6 +28,12 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _ComponentRoot_construct(id: KInt, flags: KInt): KPointer @ani.unsafe.Direct + native static _CustomLayoutRoot_construct(id: KInt, flags: KInt): KPointer + @ani.unsafe.Direct + native static _CustomLayoutRoot_subscribeOnMeasureSize(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Direct + native static _CustomLayoutRoot_subscribeOnPlaceChildren(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Direct native static _AbilityComponent_construct(id: KInt, flags: KInt): KPointer @ani.unsafe.Direct native static _AbilityComponentInterface_setAbilityComponentOptions(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void @@ -4895,6 +4901,26 @@ export class ArkUIGeneratedNativeModule { @ani.unsafe.Direct native static _ProgressMask_enableBreathingAnimation(ptr: KPointer, value: KInt): void @ani.unsafe.Direct + native static _Layoutable_ctor(): KPointer + @ani.unsafe.Direct + native static _Layoutable_getFinalizer(): KPointer + @ani.unsafe.Direct + native static _Layoutable_layout(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Quick + native static _Layoutable_getMargin(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getPadding(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getBorderWidth(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Quick + native static _Layoutable_getMeasureResult(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Direct + native static _Layoutable_setMeasureResult(ptr: KPointer, thisArray: KSerializerBuffer, thisLength: int32): void + @ani.unsafe.Quick + native static _Layoutable_getUniqueId(ptr: KPointer): KInteropReturnBuffer + @ani.unsafe.Direct + native static _Layoutable_setUniqueId(ptr: KPointer, uniqueId: number): void + @ani.unsafe.Direct native static _Measurable_ctor(): KPointer @ani.unsafe.Direct native static _Measurable_getFinalizer(): KPointer diff --git a/arkoala-arkts/arkui/src/generated/arkts/type_check.ts b/arkoala-arkts/arkui/src/generated/arkts/type_check.ts index f2720d6ab..1e09c51a8 100644 --- a/arkoala-arkts/arkui/src/generated/arkts/type_check.ts +++ b/arkoala-arkts/arkui/src/generated/arkts/type_check.ts @@ -19,7 +19,7 @@ import { KBoolean, KStringPtr, NativeBuffer, MaterializedBase } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { AccessibilityHoverType, Alignment, AnimationStatus, AppRotation, ArrowPointPosition, Axis, AxisAction, AxisModel, BarState, BorderStyle, CheckBoxShape, ClickEffectLevel, Color, ColoringStrategy, CopyOptions, CrownAction, CrownSensitivity, Curve, DialogButtonStyle, Direction, DividerMode, Edge, EdgeEffect, EmbeddedType, FillMode, FlexAlign, FlexDirection, FlexWrap, FocusDrawLevel, FoldStatus, FontWeight, FunctionKey, GradientDirection, HeightBreakpoint, HitTestMode, HorizontalAlign, HoverEffect, IlluminatedType, ImageFit, ImageRepeat, ImageSize, ImageSpanAlignment, InteractionHand, ItemAlign, KeySource, KeyType, LineBreakStrategy, LineCapStyle, LineJoinStyle, MarqueeUpdateStrategy, ModifierKey, MouseAction, MouseButton, NestedScrollMode, ObscuredReasons, OptionWidthMode, PageFlipMode, PixelRoundCalcPolicy, PixelRoundMode, Placement, PlayMode, RelateType, RenderFit, ResponseType, ScrollSource, TextAlign, SharedTransitionEffectType, TextOverflow, TextContentStyle, TextHeightAdaptivePolicy, WordBreak, TextCase, TextSelectableMode, TitleHeight, TouchType, TransitionType, VerticalAlign, Visibility, Week, WidthBreakpoint, XComponentType } from "./../enums" -import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild, Layoutable } from "./../common" +import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, Measurable, Layoutable, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, GeometryInfo, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild } from "./../common" import { Affinity, EllipsisMode, FontStyle, FontWidth, TextBox, LineMetrics, TextBaseline, TextDecorationStyle, TextDecorationType, TextDirection, FontFeature, FontVariation, RunMetrics, RectStyle, Decoration, TextShadow, text } from "./../arkui-graphics-text" import { AlphabetIndexerAttribute, Callback_Number_Void, OnAlphabetIndexerSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerPopupSelectCallback, IndexerAlign, Callback_Opt_Number_Void, AlphabetIndexerOptions } from "./../alphabet_indexer" import { ResourceColor, Font, Position, Length, SizeOptions, Offset, ColorFilter, ResourceStr, Dimension, LengthConstrain, VoidCallback, DividerStyleOptions, ConstraintSizeOptions, AccessibilityOptions, Bias, ChainWeightOptions, DirectionalEdgesT, EdgeOutlineStyles, VP, EdgeColors, LocalizedBorderRadiuses, LocalizedEdgeColors, LocalizedEdges, LocalizedEdgeWidths, LocalizedPadding, LocalizedPosition, BorderRadiuses, EdgeOutlineWidths, EdgeWidths, PX, LPX, MarkStyle, OutlineRadiuses, Padding, Area, BorderOptions, OutlineOptions } from "./../units" @@ -1111,6 +1111,9 @@ export class TypeChecker { static isGaugeShadowOptions(value: Object | string | number | undefined): boolean { return value instanceof GaugeShadowOptions } + static isGeometryInfo(value: Object | string | number | undefined, arg0: boolean, arg1: boolean, arg2: boolean): boolean { + return value instanceof GeometryInfo + } static isGeometryTransitionOptions(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { return value instanceof GeometryTransitionOptions } @@ -1402,6 +1405,9 @@ export class TypeChecker { static isLayeredDrawableDescriptor(value: Object | string | number | undefined): boolean { return value instanceof LayeredDrawableDescriptor } + static isLayoutable(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { + return value instanceof Layoutable + } static isLayoutDirection(value: Object | string | number | undefined): boolean { return value instanceof LayoutDirection } @@ -2791,6 +2797,9 @@ export class TypeChecker { static isSizeOptions(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { return value instanceof SizeOptions } + static isSizeResult(value: Object | string | number | undefined, arg0: boolean, arg1: boolean): boolean { + return value instanceof SizeResult + } static isSizeType(value: Object | string | number | undefined): boolean { return value instanceof SizeType } @@ -5563,6 +5572,12 @@ export class TypeChecker { static isArray_TouchTestInfo(value: Object | string | number | undefined): boolean { return value instanceof Array } + static isArray_Measurable(value: Object | string | number | undefined): boolean { + return value instanceof Array + } + static isArray_Layoutable(value: Object | string | number | undefined): boolean { + return value instanceof Array + } static isArray_NavDestinationTransition(value: Object | string | number | undefined): boolean { return value instanceof Array } @@ -5674,12 +5689,6 @@ export class TypeChecker { static isArray_LayoutChild(value: Object | string | number | undefined): boolean { return value instanceof Array } - static isArray_Layoutable(value: Object | string | number | undefined): boolean { - return value instanceof Array - } - static isArray_Measurable(value: Object | string | number | undefined): boolean { - return value instanceof Array - } static isArray_Tuple_Union_ResourceColor_LinearGradient_Number(value: Object | string | number | undefined): boolean { return value instanceof Array<[ ResourceColor | LinearGradient, number ]> } diff --git a/arkoala-arkts/arkui/src/generated/common.ts b/arkoala-arkts/arkui/src/generated/common.ts index 88ed063f9..98075b6ce 100644 --- a/arkoala-arkts/arkui/src/generated/common.ts +++ b/arkoala-arkts/arkui/src/generated/common.ts @@ -28,7 +28,7 @@ import { UnifiedData, UnifiedDataInternal, ComponentContent, UIContext, Context, import { Summary, IntentionCode, EdgeStyles, CircleShape, EllipseShape, PathShape, RectShape, ImageModifier, SymbolGlyphModifier } from "./arkui-external" import { Callback_Void } from "./ability_component" import { KeyType, KeySource, Color, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Visibility, ItemAlign, Direction, ObscuredReasons, RenderFit, FocusDrawLevel, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, InteractionHand, GradientDirection, Curve, SharedTransitionEffectType, ArrowPointPosition, Placement, LineCapStyle, LineJoinStyle, BarState, CrownSensitivity, EdgeEffect, PlayMode, HorizontalAlign, VerticalAlign, TransitionType, FontWeight, TouchType, CrownAction, ClickEffectLevel, NestedScrollMode, PixelRoundCalcPolicy, IlluminatedType, MouseButton, MouseAction, AccessibilityHoverType, AxisAction, AxisModel } from "./enums" -import { ResourceColor, ConstraintSizeOptions, DirectionalEdgesT, SizeOptions, Length, ChainWeightOptions, Padding, LocalizedPadding, Position, BorderOptions, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, Bias, Font } from "./units" +import { ResourceColor, Position, DirectionalEdgesT, ConstraintSizeOptions, SizeOptions, Length, ChainWeightOptions, Padding, LocalizedPadding, BorderOptions, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, Bias, Font } from "./units" import { Resource } from "./resource" import { TextRange } from "./text_common" import { ComponentBase } from "./../ComponentBase" @@ -1268,6 +1268,122 @@ export class ProgressMask implements MaterializedBase { ArkUIGeneratedNativeModule._ProgressMask_enableBreathingAnimation(this.peer!.ptr, value ? 1 : 0) } } +export interface Layoutable { + measureResult: MeasureResult + uniqueId?: number | undefined + layout(position: Position): void + getMargin(): DirectionalEdgesT + getPadding(): DirectionalEdgesT + getBorderWidth(): DirectionalEdgesT +} +export class LayoutableInternal implements MaterializedBase,Layoutable { + peer?: Finalizable | undefined = undefined + public getPeer(): Finalizable | undefined { + return this.peer + } + get measureResult(): MeasureResult { + return this.getMeasureResult() + } + set measureResult(measureResult: MeasureResult) { + this.setMeasureResult(measureResult) + } + get uniqueId(): number | undefined { + return this.getUniqueId() + } + set uniqueId(uniqueId: number | undefined) { + const uniqueId_NonNull = (uniqueId as number) + this.setUniqueId(uniqueId_NonNull) + } + static ctor_layoutable(): KPointer { + const retval = ArkUIGeneratedNativeModule._Layoutable_ctor() + return retval + } + constructor() { + const ctorPtr : KPointer = LayoutableInternal.ctor_layoutable() + this.peer = new Finalizable(ctorPtr, LayoutableInternal.getFinalizer()) + } + static getFinalizer(): KPointer { + return ArkUIGeneratedNativeModule._Layoutable_getFinalizer() + } + public layout(position: Position): void { + const position_casted = position as (Position) + this.layout_serialize(position_casted) + return + } + public getMargin(): DirectionalEdgesT { + return this.getMargin_serialize() + } + public getPadding(): DirectionalEdgesT { + return this.getPadding_serialize() + } + public getBorderWidth(): DirectionalEdgesT { + return this.getBorderWidth_serialize() + } + private getMeasureResult(): MeasureResult { + return this.getMeasureResult_serialize() + } + private setMeasureResult(measureResult: MeasureResult): void { + const measureResult_casted = measureResult as (MeasureResult) + this.setMeasureResult_serialize(measureResult_casted) + return + } + private getUniqueId(): number | undefined { + return this.getUniqueId_serialize() + } + private setUniqueId(uniqueId: number): void { + const uniqueId_casted = uniqueId as (number) + this.setUniqueId_serialize(uniqueId_casted) + return + } + private layout_serialize(position: Position): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writePosition(position) + ArkUIGeneratedNativeModule._Layoutable_layout(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + private getMargin_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getMargin(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getPadding_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getPadding(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getBorderWidth_serialize(): DirectionalEdgesT { + const retval = ArkUIGeneratedNativeModule._Layoutable_getBorderWidth(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : DirectionalEdgesT = retvalDeserializer.readDirectionalEdgesT() + return returnResult + } + private getMeasureResult_serialize(): MeasureResult { + const retval = ArkUIGeneratedNativeModule._Layoutable_getMeasureResult(this.peer!.ptr) + let retvalDeserializer : Deserializer = new Deserializer(retval, retval.length) + const returnResult : MeasureResult = retvalDeserializer.readMeasureResult() + return returnResult + } + private setMeasureResult_serialize(measureResult: MeasureResult): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.writeMeasureResult(measureResult) + ArkUIGeneratedNativeModule._Layoutable_setMeasureResult(this.peer!.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + private getUniqueId_serialize(): number | undefined { + const retval = ArkUIGeneratedNativeModule._Layoutable_getUniqueId(this.peer!.ptr) + throw new Error("Object deserialization is not implemented.") + } + private setUniqueId_serialize(uniqueId: number): void { + ArkUIGeneratedNativeModule._Layoutable_setUniqueId(this.peer!.ptr, uniqueId) + } + public static fromPtr(ptr: KPointer): LayoutableInternal { + const obj : LayoutableInternal = new LayoutableInternal() + obj.peer = new Finalizable(ptr, LayoutableInternal.getFinalizer()) + return obj + } +} export interface Measurable { uniqueId?: number | undefined measure(constraint: ConstraintSizeOptions): MeasureResult @@ -9895,9 +10011,6 @@ export interface GeometryInfo extends SizeResult { margin: Padding; padding: Padding; } -export interface Layoutable { - stub: string; -} export interface SizeResult { width: number; height: number; diff --git a/arkoala-arkts/arkui/src/generated/generator_synthetic.ts b/arkoala-arkts/arkui/src/generated/generator_synthetic.ts index 6a2975b23..e0df99dc0 100644 --- a/arkoala-arkts/arkui/src/generated/generator_synthetic.ts +++ b/arkoala-arkts/arkui/src/generated/generator_synthetic.ts @@ -18,8 +18,8 @@ import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" +import { SizeResult, TouchResult, CustomBuilder, DragItemInfo } from "./common" import { GestureJudgeResult, GestureRecognizer } from "./gesture" -import { TouchResult, CustomBuilder, DragItemInfo } from "./common" import { HitTestMode } from "./enums" import { NavigationAnimatedTransition } from "./navigation" import { Tuple_Number_Number } from "./arkui-synthetics" @@ -32,6 +32,7 @@ import { WithThemeAttribute } from "./with_theme" import { WebKeyboardOptions, WebResourceResponse } from "./web" import { UserDataSpan, StyledString, CustomSpanMetrics } from "./styled_string" export type Callback_Pointer_Void = (value: KPointer) => void; +export type Callback_SizeResult_Void = (value: SizeResult) => void; export type Callback_Array_String_Void = (value: Array) => void; export type Callback_GestureJudgeResult_Void = (value: GestureJudgeResult) => void; export type Callback_GestureRecognizer_Void = (value: GestureRecognizer) => void; diff --git a/arkoala-arkts/arkui/src/generated/peers/CallbackDeserializeCall.ts b/arkoala-arkts/arkui/src/generated/peers/CallbackDeserializeCall.ts index 373b564b8..2de32ccb8 100644 --- a/arkoala-arkts/arkui/src/generated/peers/CallbackDeserializeCall.ts +++ b/arkoala-arkts/arkui/src/generated/peers/CallbackDeserializeCall.ts @@ -21,15 +21,15 @@ import { Deserializer } from "./Deserializer" import { int32, float32, int64 } from "@koalaui/common" import { ResourceHolder, KInt, KStringPtr, wrapSystemCallback, KPointer, RuntimeType, KSerializerBuffer, NativeBuffer } from "@koalaui/interop" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityHoverEvent, AccessibilityFocusCallback, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, Callback_AxisEvent_Void, AxisEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, Callback_ClickEvent_Void, ClickEvent, Callback_CrownEvent_Void, CrownEvent, CustomBuilder, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, ItemDragInfo, Callback_KeyEvent_Boolean, KeyEvent, Callback_KeyEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_MouseEvent_Void, MouseEvent, Callback_PreDragStatus_Void, PreDragStatus, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, SheetType, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, TouchEvent, Callback_TouchEvent_Void, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, PopupStateChangeParam, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback } from "./../common" +import { AccessibilityCallback, AccessibilityHoverEvent, AccessibilityFocusCallback, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, Callback_AxisEvent_Void, AxisEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, Callback_ClickEvent_Void, ClickEvent, Callback_CrownEvent_Void, CrownEvent, CustomBuilder, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, ItemDragInfo, Callback_KeyEvent_Boolean, KeyEvent, Callback_KeyEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_MouseEvent_Void, MouseEvent, GeometryInfo, Measurable, SizeResult, Layoutable, Callback_PreDragStatus_Void, PreDragStatus, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, SheetType, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, TouchEvent, Callback_TouchEvent_Void, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, PopupStateChangeParam, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback } from "./../common" import { AsyncCallback_Array_TextMenuItem_Array_TextMenuItem, TextMenuItem, AsyncCallback_TextMenuItem_TextRange_Boolean, TextRange, DeleteValue, EditableTextChangeValue, InsertValue, Callback_StyledStringChangeValue_Boolean, StyledStringChangeValue, EditableTextOnChangeCallback, PreviewText, TextChangeOptions, OnDidChangeCallback } from "./../text_common" import { AsyncCallback_CustomSpanMeasureInfo_CustomSpanMetrics, CustomSpanMeasureInfo, CustomSpanMetrics, Callback_DrawContext_CustomSpanDrawInfo_Void, CustomSpanDrawInfo, StyledString, UserDataSpan, StyledStringMarshallCallback, StyledStringUnmarshallCallback } from "./../styled_string" import { AsyncCallback_image_PixelMap_Void, ReceiveCallback } from "./../arkui-external" import { PixelMap } from "./../arkui-pixelmap" import { ButtonTriggerClickCallback } from "./../button" -import { Area, ResourceStr, SizeOptions, VoidCallback } from "./../units" +import { Area, ConstraintSizeOptions, ResourceStr, SizeOptions, VoidCallback } from "./../units" import { Callback_Array_Number_Void } from "./../pattern_lock" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_Boolean, Callback_NavDestinationActiveReason_Void, NavDestinationActiveReason, Callback_NavDestinationContext_Void, NavDestinationContext, Callback_Object_Void, NavDestinationTransition, NavDestinationTransitionDelegate } from "./../nav_destination" import { Callback_Boolean_Void, Callback_NavigationMode_Void, NavigationMode, Callback_NavigationTitleMode_Void, NavigationTitleMode, Callback_NavigationTransitionProxy_Void, NavigationTransitionProxy, NavigationAnimatedTransition, Callback_PopInfo_Void, PopInfo, Callback_String_Opt_Object_Void, InterceptionModeCallback, InterceptionShowCallback, NavBar, NavigationOperation, Type_NavigationAttribute_customNavContentTransition_delegate, NavContentInfo } from "./../navigation" import { Callback_CalendarRequestedData_Void, CalendarRequestedData, Callback_CalendarSelectedDate_Void, CalendarSelectedDate } from "./../calendar" @@ -58,6 +58,7 @@ import { Callback_Number_String_Void, Callback_Opt_ResourceStr_Void, Callback_Op import { Tuple_Number_Number } from "./../arkui-synthetics" import { Callback_Number_Void, Callback_Opt_Number_Void, OnAlphabetIndexerPopupSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerSelectCallback } from "./../alphabet_indexer" import { OffsetResult, OnScrollFrameBeginHandlerResult, OnScrollEdgeCallback, OnScrollFrameBeginCallback, ScrollOnScrollCallback, ScrollOnWillScrollCallback } from "./../scroll" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_Opt_Boolean_Void, OnCheckboxChangeCallback } from "./../checkbox" import { Resource } from "./../resource" import { TabContentAnimatedTransition, Callback_TabContentTransitionProxy_Void, TabContentTransitionProxy, OnTabsAnimationEndCallback, TabsAnimationEvent, OnTabsAnimationStartCallback, OnTabsContentWillChangeCallback, OnTabsGestureSwipeCallback, TabsCustomContentTransitionCallback } from "./../tabs" @@ -875,6 +876,21 @@ export function deserializeAndCallCallback_OnLoadInterceptEvent_Boolean(thisDese const _callResult = _call(parameter) _continuation(_callResult) } +export function deserializeAndCallCallback_onMeasureSize_SizeResult(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as Callback_onMeasureSize_SizeResult) + let selfLayoutInfo : GeometryInfo = thisDeserializer.readGeometryInfo() + const children_buf_length : int32 = thisDeserializer.readInt32() + let children_buf : Array = new Array(children_buf_length) + for (let children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf[children_buf_i] = (thisDeserializer.readMeasurable() as Measurable) + } + let children : Array = children_buf + let constraint : ConstraintSizeOptions = thisDeserializer.readConstraintSizeOptions() + let _continuation : ((value: SizeResult) => void) = thisDeserializer.readCallback_SizeResult_Void(true) + const _callResult = _call(selfLayoutInfo, children, constraint) + _continuation(_callResult) +} export function deserializeAndCallCallback_OnOverScrollEvent_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: OnOverScrollEvent) => void)) @@ -905,6 +921,19 @@ export function deserializeAndCallCallback_OnPermissionRequestEvent_Void(thisDes let parameter : OnPermissionRequestEvent = thisDeserializer.readOnPermissionRequestEvent() _call(parameter) } +export function deserializeAndCallCallback_onPlaceChildren_Void(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as Callback_onPlaceChildren_Void) + let selfLayoutInfo : GeometryInfo = thisDeserializer.readGeometryInfo() + const children_buf_length : int32 = thisDeserializer.readInt32() + let children_buf : Array = new Array(children_buf_length) + for (let children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf[children_buf_i] = (thisDeserializer.readLayoutable() as Layoutable) + } + let children : Array = children_buf + let constraint : ConstraintSizeOptions = thisDeserializer.readConstraintSizeOptions() + _call(selfLayoutInfo, children, constraint) +} export function deserializeAndCallCallback_OnProgressChangeEvent_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: OnProgressChangeEvent) => void)) @@ -1278,6 +1307,12 @@ export function deserializeAndCallCallback_SheetType_Void(thisDeserializer: Dese let parameter : SheetType = TypeChecker.SheetType_FromNumeric(thisDeserializer.readInt32()) _call(parameter) } +export function deserializeAndCallCallback_SizeResult_Void(thisDeserializer: Deserializer): void { + const _resourceId : int32 = thisDeserializer.readInt32() + const _call = (ResourceHolder.instance().get(_resourceId) as ((value: SizeResult) => void)) + let value : SizeResult = thisDeserializer.readSizeResult() + _call(value) +} export function deserializeAndCallCallback_SpringBackAction_Void(thisDeserializer: Deserializer): void { const _resourceId : int32 = thisDeserializer.readInt32() const _call = (ResourceHolder.instance().get(_resourceId) as ((parameter: SpringBackAction) => void)) @@ -2607,11 +2642,13 @@ export function deserializeAndCallCallback(thisDeserializer: Deserializer): void case -2066745559/*CallbackKind.Kind_Callback_OnHttpErrorReceiveEvent_Void*/: return deserializeAndCallCallback_OnHttpErrorReceiveEvent_Void(thisDeserializer); case 1442698200/*CallbackKind.Kind_Callback_OnInterceptRequestEvent_WebResourceResponse*/: return deserializeAndCallCallback_OnInterceptRequestEvent_WebResourceResponse(thisDeserializer); case 1231444306/*CallbackKind.Kind_Callback_OnLoadInterceptEvent_Boolean*/: return deserializeAndCallCallback_OnLoadInterceptEvent_Boolean(thisDeserializer); + case -1356285653/*CallbackKind.Kind_Callback_onMeasureSize_SizeResult*/: return deserializeAndCallCallback_onMeasureSize_SizeResult(thisDeserializer); case -860386431/*CallbackKind.Kind_Callback_OnOverScrollEvent_Void*/: return deserializeAndCallCallback_OnOverScrollEvent_Void(thisDeserializer); case -2040193994/*CallbackKind.Kind_Callback_OnPageBeginEvent_Void*/: return deserializeAndCallCallback_OnPageBeginEvent_Void(thisDeserializer); case -130135362/*CallbackKind.Kind_Callback_OnPageEndEvent_Void*/: return deserializeAndCallCallback_OnPageEndEvent_Void(thisDeserializer); case 1805946367/*CallbackKind.Kind_Callback_OnPageVisibleEvent_Void*/: return deserializeAndCallCallback_OnPageVisibleEvent_Void(thisDeserializer); case 529980696/*CallbackKind.Kind_Callback_OnPermissionRequestEvent_Void*/: return deserializeAndCallCallback_OnPermissionRequestEvent_Void(thisDeserializer); + case -738620506/*CallbackKind.Kind_Callback_onPlaceChildren_Void*/: return deserializeAndCallCallback_onPlaceChildren_Void(thisDeserializer); case 1018740377/*CallbackKind.Kind_Callback_OnProgressChangeEvent_Void*/: return deserializeAndCallCallback_OnProgressChangeEvent_Void(thisDeserializer); case -1826742986/*CallbackKind.Kind_Callback_OnPromptEvent_Boolean*/: return deserializeAndCallCallback_OnPromptEvent_Boolean(thisDeserializer); case 1978364344/*CallbackKind.Kind_Callback_OnRefreshAccessedHistoryEvent_Void*/: return deserializeAndCallCallback_OnRefreshAccessedHistoryEvent_Void(thisDeserializer); @@ -2653,6 +2690,7 @@ export function deserializeAndCallCallback(thisDeserializer: Deserializer): void case 1980824326/*CallbackKind.Kind_Callback_RichEditorTextSpanResult_Void*/: return deserializeAndCallCallback_RichEditorTextSpanResult_Void(thisDeserializer); case 22609082/*CallbackKind.Kind_Callback_SheetDismiss_Void*/: return deserializeAndCallCallback_SheetDismiss_Void(thisDeserializer); case -224451112/*CallbackKind.Kind_Callback_SheetType_Void*/: return deserializeAndCallCallback_SheetType_Void(thisDeserializer); + case 1318865891/*CallbackKind.Kind_Callback_SizeResult_Void*/: return deserializeAndCallCallback_SizeResult_Void(thisDeserializer); case 1536231691/*CallbackKind.Kind_Callback_SpringBackAction_Void*/: return deserializeAndCallCallback_SpringBackAction_Void(thisDeserializer); case -879490874/*CallbackKind.Kind_Callback_String_Number_Void*/: return deserializeAndCallCallback_String_Number_Void(thisDeserializer); case -716524508/*CallbackKind.Kind_Callback_String_Opt_Object_Void*/: return deserializeAndCallCallback_String_Opt_Object_Void(thisDeserializer); diff --git a/arkoala-arkts/arkui/src/generated/peers/CallbackKind.ts b/arkoala-arkts/arkui/src/generated/peers/CallbackKind.ts index f92e54d00..cb9024e1b 100644 --- a/arkoala-arkts/arkui/src/generated/peers/CallbackKind.ts +++ b/arkoala-arkts/arkui/src/generated/peers/CallbackKind.ts @@ -106,11 +106,13 @@ export enum CallbackKind { Kind_Callback_OnHttpErrorReceiveEvent_Void = -2066745559, Kind_Callback_OnInterceptRequestEvent_WebResourceResponse = 1442698200, Kind_Callback_OnLoadInterceptEvent_Boolean = 1231444306, + Kind_Callback_onMeasureSize_SizeResult = -1356285653, Kind_Callback_OnOverScrollEvent_Void = -860386431, Kind_Callback_OnPageBeginEvent_Void = -2040193994, Kind_Callback_OnPageEndEvent_Void = -130135362, Kind_Callback_OnPageVisibleEvent_Void = 1805946367, Kind_Callback_OnPermissionRequestEvent_Void = 529980696, + Kind_Callback_onPlaceChildren_Void = -738620506, Kind_Callback_OnProgressChangeEvent_Void = 1018740377, Kind_Callback_OnPromptEvent_Boolean = -1826742986, Kind_Callback_OnRefreshAccessedHistoryEvent_Void = 1978364344, @@ -152,6 +154,7 @@ export enum CallbackKind { Kind_Callback_RichEditorTextSpanResult_Void = 1980824326, Kind_Callback_SheetDismiss_Void = 22609082, Kind_Callback_SheetType_Void = -224451112, + Kind_Callback_SizeResult_Void = 1318865891, Kind_Callback_SpringBackAction_Void = 1536231691, Kind_Callback_String_Number_Void = -879490874, Kind_Callback_String_Opt_Object_Void = -716524508, diff --git a/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts b/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts index 42990c7d7..163b4cfd3 100644 --- a/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts +++ b/arkoala-arkts/arkui/src/generated/peers/Deserializer.ts @@ -22,9 +22,10 @@ import { CallbackKind } from "./CallbackKind" import { Serializer } from "./Serializer" import { TypeChecker } from "#components" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasurableInternal, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" +import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, GeometryInfo, Measurable, MeasurableInternal, Layoutable, LayoutableInternal, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, ControlSize, ButtonOptions } from "./../button" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../animation_extender" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_RangeUpdate, Context_getGroupDir_Callback, RestrictedWorker_onerror_Callback, RestrictedWorker_onexit_Callback, RestrictedWorker_onmessage_Callback, ComponentContent, ComponentContentInternal, UnifiedData, UnifiedDataInternal, UIContext, UIContextInternal, SystemBarStyle, PointerStyle, Scene, SceneInternal, Context, ContextInternal, WorkerEventListener, WorkerEventListenerInternal, Event, ErrorEvent, MessageEvents, BaseContext, BaseContextInternal, PostMessageOptions, WorkerOptions, CustomColors, RestrictedWorker, RestrictedWorkerInternal, CustomTheme } from "./../arkui-custom" import { ContentDidScrollCallback, ContentWillScrollCallback, OnSwiperAnimationEndCallback, OnSwiperAnimationStartCallback, OnSwiperGestureSwipeCallback, SwiperAnimationEvent, SwiperAnimationMode, SwiperAttribute, DotIndicator, DigitIndicator, SwiperDisplayMode, SwiperNestedScrollMode, SwiperContentAnimatedTransition, SwiperContentWillScrollResult, AutoPlayOptions, ArrowStyle, SwiperAutoFill, SwiperContentTransitionProxy, SwiperContentTransitionProxyInternal, SwiperController, SwiperControllerInternal, Callback_SwiperContentTransitionProxy_Void, Indicator } from "./../swiper" import { CustomNodeBuilder } from "./../custom_builder" @@ -133,7 +134,7 @@ import { TextTimerController, TextTimerControllerInternal, TextTimerOptions } fr import { ToggleType, ToggleOptions, SwitchStyle } from "./../toggle" import { UniformDataType } from "./../arkui-uniformtypedescriptor" import { WindowSceneAttribute } from "./../window_scene" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_DismissDialogAction_Void, DismissDialogAction, ImmersiveMode, LevelMode, ActionSheetButtonOptions, ActionSheetOffset, SheetInfo, ActionSheetOptions } from "./../action_sheet" import { Want } from "./../ohos.app.ability" import { Callback_TerminationInfo_Void, TerminationInfo } from "./../embedded_component" @@ -852,6 +853,13 @@ export class Deserializer extends DeserializerBase { let value : Size = ({width: width_result, height: height_result} as Size) return value } + public readSizeResult(): SizeResult { + let valueDeserializer : Deserializer = this + const width_result : number = (valueDeserializer.readNumber() as number) + const height_result : number = (valueDeserializer.readNumber() as number) + let value : SizeResult = ({width: width_result, height: height_result} as SizeResult) + return value + } public readSliderAttribute(): SliderAttribute { throw new Error("Interface with functions is not supported") } @@ -2860,6 +2868,29 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return (_continuationValue as boolean); } } + public readCallback_onMeasureSize_SizeResult(isSync: boolean = false): Callback_onMeasureSize_SizeResult { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions):SizeResult => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeGeometryInfo(selfLayoutInfo); + _argsSerializer.writeInt32(children.length as int32); + for (let i = 0; i < children.length; i++) { + const children_element : Measurable = children[i]; + _argsSerializer.writeMeasurable(children_element); + } + _argsSerializer.writeConstraintSizeOptions(constraint); + let _continuationValue : SizeResult | undefined; + const _continuationCallback : ((value: SizeResult) => void) = (value: SizeResult):void => { _continuationValue = value; } + _argsSerializer.holdAndWriteCallback(_continuationCallback); + (isSync) ? (InteropNativeModule._CallCallbackSync(-1356285653, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(-1356285653, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return (_continuationValue as SizeResult); } + } public readCallback_OnOverScrollEvent_Void(isSync: boolean = false): ((parameter: OnOverScrollEvent) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -2930,6 +2961,26 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return; } } + public readCallback_onPlaceChildren_Void(isSync: boolean = false): Callback_onPlaceChildren_Void { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions):void => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeGeometryInfo(selfLayoutInfo); + _argsSerializer.writeInt32(children.length as int32); + for (let i = 0; i < children.length; i++) { + const children_element : Layoutable = children[i]; + _argsSerializer.writeLayoutable(children_element); + } + _argsSerializer.writeConstraintSizeOptions(constraint); + (isSync) ? (InteropNativeModule._CallCallbackSync(-738620506, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(-738620506, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return; } + } public readCallback_OnProgressChangeEvent_Void(isSync: boolean = false): ((parameter: OnProgressChangeEvent) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -3633,6 +3684,20 @@ export class Deserializer extends DeserializerBase { _argsSerializer.release(); return; } } + public readCallback_SizeResult_Void(isSync: boolean = false): ((value: SizeResult) => void) { + const _resource : CallbackResource = this.readCallbackResource() + const _call : KPointer = this.readPointer() + const _callSync : KPointer = this.readPointer() + return (value: SizeResult):void => { + const _argsSerializer : Serializer = Serializer.hold(); + _argsSerializer.writeInt32(_resource.resourceId); + _argsSerializer.writePointer(_call); + _argsSerializer.writePointer(_callSync); + _argsSerializer.writeSizeResult(value); + (isSync) ? (InteropNativeModule._CallCallbackSync(1318865891, _argsSerializer.asBuffer(), _argsSerializer.length())) : (InteropNativeModule._CallCallback(1318865891, _argsSerializer.asBuffer(), _argsSerializer.length())); + _argsSerializer.release(); + return; } + } public readCallback_SpringBackAction_Void(isSync: boolean = false): ((parameter: SpringBackAction) => void) { const _resource : CallbackResource = this.readCallbackResource() const _call : KPointer = this.readPointer() @@ -14719,6 +14784,11 @@ export class Deserializer extends DeserializerBase { let value : JavaScriptProxy = ({object_: object__result, name: name_result, methodList: methodList_result, controller: controller_result, asyncMethodList: asyncMethodList_result, permission: permission_result} as JavaScriptProxy) return value } + public readLayoutable(): Layoutable { + let valueDeserializer : Deserializer = this + let ptr : KPointer = valueDeserializer.readPointer() + return LayoutableInternal.fromPtr(ptr) + } public readLengthConstrain(): LengthConstrain { let valueDeserializer : Deserializer = this const minLength_buf_selector : int32 = valueDeserializer.readInt8() @@ -25560,6 +25630,100 @@ export class Deserializer extends DeserializerBase { let ptr : KPointer = valueDeserializer.readPointer() return FocusAxisEventInternal.fromPtr(ptr) } + public readGeometryInfo(): GeometryInfo { + let valueDeserializer : Deserializer = this + const width_result : number = (valueDeserializer.readNumber() as number) + const height_result : number = (valueDeserializer.readNumber() as number) + const borderWidth_result : EdgeWidths = valueDeserializer.readEdgeWidths() + const margin_result : Padding = valueDeserializer.readPadding() + const padding_buf_top_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_top_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_top_buf_runtimeType)) + { + const padding_buf_top_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_top_buf_ : string | number | Resource | undefined + if (padding_buf_top_buf__selector == 0) { + padding_buf_top_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_top_buf__selector == 1) { + padding_buf_top_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_top_buf__selector == 2) { + padding_buf_top_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_top_buf_ has to be chosen through deserialisation.") + } + padding_buf_top_buf = (padding_buf_top_buf_ as string | number | Resource) + } + const padding_buf_top : undefined | Length = padding_buf_top_buf + const padding_buf_right_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_right_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_right_buf_runtimeType)) + { + const padding_buf_right_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_right_buf_ : string | number | Resource | undefined + if (padding_buf_right_buf__selector == 0) { + padding_buf_right_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_right_buf__selector == 1) { + padding_buf_right_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_right_buf__selector == 2) { + padding_buf_right_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_right_buf_ has to be chosen through deserialisation.") + } + padding_buf_right_buf = (padding_buf_right_buf_ as string | number | Resource) + } + const padding_buf_right : undefined | Length = padding_buf_right_buf + const padding_buf_bottom_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_bottom_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_bottom_buf_runtimeType)) + { + const padding_buf_bottom_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_bottom_buf_ : string | number | Resource | undefined + if (padding_buf_bottom_buf__selector == 0) { + padding_buf_bottom_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_bottom_buf__selector == 1) { + padding_buf_bottom_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_bottom_buf__selector == 2) { + padding_buf_bottom_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_bottom_buf_ has to be chosen through deserialisation.") + } + padding_buf_bottom_buf = (padding_buf_bottom_buf_ as string | number | Resource) + } + const padding_buf_bottom : undefined | Length = padding_buf_bottom_buf + const padding_buf_left_buf_runtimeType = (valueDeserializer.readInt8() as int32) + let padding_buf_left_buf : Length | undefined + if ((RuntimeType.UNDEFINED) != (padding_buf_left_buf_runtimeType)) + { + const padding_buf_left_buf__selector : int32 = valueDeserializer.readInt8() + let padding_buf_left_buf_ : string | number | Resource | undefined + if (padding_buf_left_buf__selector == 0) { + padding_buf_left_buf_ = (valueDeserializer.readString() as string) + } + else if (padding_buf_left_buf__selector == 1) { + padding_buf_left_buf_ = (valueDeserializer.readNumber() as number) + } + else if (padding_buf_left_buf__selector == 2) { + padding_buf_left_buf_ = valueDeserializer.readResource() + } + else { + throw new Error("One of the branches for padding_buf_left_buf_ has to be chosen through deserialisation.") + } + padding_buf_left_buf = (padding_buf_left_buf_ as string | number | Resource) + } + const padding_buf_left : undefined | Length = padding_buf_left_buf + const padding_result : Padding = ({top: padding_buf_top, right: padding_buf_right, bottom: padding_buf_bottom, left: padding_buf_left} as Padding) + let value : GeometryInfo = ({width: width_result, height: height_result, borderWidth: borderWidth_result, margin: margin_result, padding: padding_result} as GeometryInfo) + return value + } public readGestureEvent(): GestureEvent { let valueDeserializer : Deserializer = this let ptr : KPointer = valueDeserializer.readPointer() diff --git a/arkoala-arkts/arkui/src/generated/peers/Serializer.ts b/arkoala-arkts/arkui/src/generated/peers/Serializer.ts index ec48b662a..6819bc599 100644 --- a/arkoala-arkts/arkui/src/generated/peers/Serializer.ts +++ b/arkoala-arkts/arkui/src/generated/peers/Serializer.ts @@ -21,9 +21,10 @@ import { int32, int64, float32, unsafeCast } from "@koalaui/common" import { CallbackKind } from "./CallbackKind" import { TypeChecker } from "#components" import { CallbackTransformer } from "./../../CallbackTransformer" -import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasurableInternal, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" +import { AccessibilityCallback, AccessibilityFocusCallback, GestureRecognizerJudgeBeginCallback, HoverCallback, OnDragEventCallback, OnMoveHandler, OnScrollCallback, PopupStateChangeCallback, ReuseIdCallback, ShouldBuiltInRecognizerParallelWithCallback, SizeChangeCallback, TransitionFinishCallback, VisibleAreaChangeCallback, AccessibilityHoverEvent, AccessibilityHoverEventInternal, AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragEventInternal, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, DrawModifierInternal, EffectEdge, EffectType, FinishCallbackType, GestureModifier, GestureModifierInternal, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, ICurveInternal, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, ChildrenMainSizeInternal, RectResult, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PixelMapMockInternal, PopupStateChangeParam, PreDragStatus, ProgressMask, ProgressMaskInternal, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, TextContentControllerBaseInternal, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffectInternal, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, UICommonEventInternal, Callback_ClickEvent_Void, ClickEvent, ClickEventInternal, Callback_TouchEvent_Void, TouchEvent, TouchEventInternal, Callback_KeyEvent_Void, KeyEvent, KeyEventInternal, HoverEvent, HoverEventInternal, Callback_MouseEvent_Void, MouseEvent, MouseEventInternal, VisibleAreaEventOptions, SheetOptions, View, ViewInternal, Callback_KeyEvent_Boolean, Callback_Area_Area_Void, Callback_Array_TouchTestInfo_TouchResult, TouchResult, Callback_AxisEvent_Void, AxisEvent, AxisEventInternal, Callback_Boolean_HoverEvent_Void, Callback_CrownEvent_Void, CrownEvent, Callback_DismissContentCoverAction_Void, DismissContentCoverAction, Callback_DismissPopupAction_Void, DismissPopupAction, Callback_DismissSheetAction_Void, DismissSheetAction, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragItemInfo, Callback_DragEvent_String_Void, Callback_FocusAxisEvent_Void, FocusAxisEvent, FocusAxisEventInternal, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, Callback_HoverEvent_Void, Callback_Literal_Boolean_isVisible_Void, Literal_Boolean_isVisible, GeometryInfo, Measurable, MeasurableInternal, Layoutable, LayoutableInternal, Callback_PreDragStatus_Void, Callback_SheetDismiss_Void, SheetDismiss, Callback_SheetType_Void, Callback_SpringBackAction_Void, SpringBackAction, Callback_TouchEvent_HitTestMode, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, DateRange, DragInteractionOptions, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, LinearGradient_common, Tuple_ResourceColor_Number, LinearGradientBlurOptions, FractionStop, LinearGradientOptions, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, StateStyles, SystemAdaptiveOptions, TouchObject, AlignRuleOption, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, BlurStyleOptions, ContentCoverOptions, BindOptions, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Literal_ResourceColor_color, EventTarget, BaseEvent, BaseEventInternal, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, PopupOptions, Literal_String_value_Callback_Void_action } from "./../common" import { ButtonTriggerClickCallback, ButtonRole, ButtonStyleMode, ButtonType, ControlSize, ButtonOptions } from "./../button" import { Callback_Extender_OnFinish, Callback_Extender_OnProgress, DoubleAnimationParam } from "./../animation_extender" +import { Callback_onMeasureSize_SizeResult, Callback_onPlaceChildren_Void } from "./../static_components" import { Callback_RangeUpdate, Context_getGroupDir_Callback, RestrictedWorker_onerror_Callback, RestrictedWorker_onexit_Callback, RestrictedWorker_onmessage_Callback, ComponentContent, ComponentContentInternal, UnifiedData, UnifiedDataInternal, UIContext, UIContextInternal, SystemBarStyle, PointerStyle, Scene, SceneInternal, Context, ContextInternal, WorkerEventListener, WorkerEventListenerInternal, Event, ErrorEvent, MessageEvents, BaseContext, BaseContextInternal, PostMessageOptions, WorkerOptions, CustomColors, RestrictedWorker, RestrictedWorkerInternal, CustomTheme } from "./../arkui-custom" import { ContentDidScrollCallback, ContentWillScrollCallback, OnSwiperAnimationEndCallback, OnSwiperAnimationStartCallback, OnSwiperGestureSwipeCallback, SwiperAnimationEvent, SwiperAnimationMode, SwiperAttribute, DotIndicator, DigitIndicator, SwiperDisplayMode, SwiperNestedScrollMode, SwiperContentAnimatedTransition, SwiperContentWillScrollResult, AutoPlayOptions, ArrowStyle, SwiperAutoFill, SwiperContentTransitionProxy, SwiperContentTransitionProxyInternal, SwiperController, SwiperControllerInternal, Callback_SwiperContentTransitionProxy_Void, Indicator } from "./../swiper" import { CustomNodeBuilder } from "./../custom_builder" @@ -132,7 +133,7 @@ import { TextTimerController, TextTimerControllerInternal, TextTimerOptions } fr import { ToggleType, ToggleOptions, SwitchStyle } from "./../toggle" import { UniformDataType } from "./../arkui-uniformtypedescriptor" import { WindowSceneAttribute } from "./../window_scene" -import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" +import { Callback_Array_String_Void, Callback_Array_TextMenuItem_Void, Callback_Buffer_Void, Callback_ComputedBarAttribute_Void, Callback_CustomBuilder_Void, Callback_CustomSpanMetrics_Void, Callback_GestureJudgeResult_Void, Callback_GestureRecognizer_Void, Callback_HitTestMode_Void, Callback_Literal_Number_offsetRemain_Void, Callback_OffsetResult_Void, Callback_OnScrollFrameBeginHandlerResult_Void, Callback_Opt_Array_NavDestinationTransition_Void, Callback_Opt_Array_String_Void, Callback_Opt_NavigationAnimatedTransition_Void, Callback_Opt_StyledString_Opt_Array_String_Void, Callback_Opt_TabContentAnimatedTransition_Void, Callback_Pointer_Void, Callback_SizeResult_Void, Callback_StyledStringMarshallingValue_Void, Callback_TouchResult_Void, Callback_Tuple_Number_Number_Number_Number_Void, Callback_Tuple_Number_Number_Void, Callback_Union_CustomBuilder_DragItemInfo_Void, Callback_WebKeyboardOptions_Void, Callback_WebResourceResponse_Void, Callback_WithThemeAttribute_Void } from "./../generator_synthetic" import { Callback_DismissDialogAction_Void, DismissDialogAction, ImmersiveMode, LevelMode, ActionSheetButtonOptions, ActionSheetOffset, SheetInfo, ActionSheetOptions } from "./../action_sheet" import { Want } from "./../ohos.app.ability" import { Callback_TerminationInfo_Void, TerminationInfo } from "./../embedded_component" @@ -758,6 +759,13 @@ export class Serializer extends SerializerBase { const value_height = value.height valueSerializer.writeNumber(value_height) } + public writeSizeResult(value: SizeResult): void { + let valueSerializer : Serializer = this + const value_width = value.width + valueSerializer.writeNumber(value_width) + const value_height = value.height + valueSerializer.writeNumber(value_height) + } public writeSliderAttribute(value: SliderAttribute): void { } public writeSpringMotion(value: SpringMotion): void { @@ -10571,6 +10579,10 @@ export class Serializer extends SerializerBase { valueSerializer.writeString(value_permission_value) } } + public writeLayoutable(value: Layoutable): void { + let valueSerializer : Serializer = this + valueSerializer.writePointer(toPeerPtr(value)) + } public writeLengthConstrain(value: LengthConstrain): void { let valueSerializer : Serializer = this const value_minLength = value.minLength @@ -23012,6 +23024,114 @@ export class Serializer extends SerializerBase { let valueSerializer : Serializer = this valueSerializer.writePointer(toPeerPtr(value)) } + public writeGeometryInfo(value: GeometryInfo): void { + let valueSerializer : Serializer = this + const value_width = value.width + valueSerializer.writeNumber(value_width) + const value_height = value.height + valueSerializer.writeNumber(value_height) + const value_borderWidth = value.borderWidth + valueSerializer.writeEdgeWidths(value_borderWidth) + const value_margin = value.margin + valueSerializer.writePadding(value_margin) + const value_padding = value.padding + const value_padding_top = value_padding.top + let value_padding_top_type : int32 = RuntimeType.UNDEFINED + value_padding_top_type = runtimeType(value_padding_top) + valueSerializer.writeInt8(value_padding_top_type) + if ((RuntimeType.UNDEFINED) != (value_padding_top_type)) { + const value_padding_top_value = value_padding_top! + let value_padding_top_value_type : int32 = RuntimeType.UNDEFINED + value_padding_top_value_type = runtimeType(value_padding_top_value) + if (RuntimeType.STRING == value_padding_top_value_type) { + valueSerializer.writeInt8(0) + const value_padding_top_value_0 = value_padding_top_value as string + valueSerializer.writeString(value_padding_top_value_0) + } + else if (RuntimeType.NUMBER == value_padding_top_value_type) { + valueSerializer.writeInt8(1) + const value_padding_top_value_1 = value_padding_top_value as number + valueSerializer.writeNumber(value_padding_top_value_1) + } + else if (RuntimeType.OBJECT == value_padding_top_value_type) { + valueSerializer.writeInt8(2) + const value_padding_top_value_2 = value_padding_top_value as Resource + valueSerializer.writeResource(value_padding_top_value_2) + } + } + const value_padding_right = value_padding.right + let value_padding_right_type : int32 = RuntimeType.UNDEFINED + value_padding_right_type = runtimeType(value_padding_right) + valueSerializer.writeInt8(value_padding_right_type) + if ((RuntimeType.UNDEFINED) != (value_padding_right_type)) { + const value_padding_right_value = value_padding_right! + let value_padding_right_value_type : int32 = RuntimeType.UNDEFINED + value_padding_right_value_type = runtimeType(value_padding_right_value) + if (RuntimeType.STRING == value_padding_right_value_type) { + valueSerializer.writeInt8(0) + const value_padding_right_value_0 = value_padding_right_value as string + valueSerializer.writeString(value_padding_right_value_0) + } + else if (RuntimeType.NUMBER == value_padding_right_value_type) { + valueSerializer.writeInt8(1) + const value_padding_right_value_1 = value_padding_right_value as number + valueSerializer.writeNumber(value_padding_right_value_1) + } + else if (RuntimeType.OBJECT == value_padding_right_value_type) { + valueSerializer.writeInt8(2) + const value_padding_right_value_2 = value_padding_right_value as Resource + valueSerializer.writeResource(value_padding_right_value_2) + } + } + const value_padding_bottom = value_padding.bottom + let value_padding_bottom_type : int32 = RuntimeType.UNDEFINED + value_padding_bottom_type = runtimeType(value_padding_bottom) + valueSerializer.writeInt8(value_padding_bottom_type) + if ((RuntimeType.UNDEFINED) != (value_padding_bottom_type)) { + const value_padding_bottom_value = value_padding_bottom! + let value_padding_bottom_value_type : int32 = RuntimeType.UNDEFINED + value_padding_bottom_value_type = runtimeType(value_padding_bottom_value) + if (RuntimeType.STRING == value_padding_bottom_value_type) { + valueSerializer.writeInt8(0) + const value_padding_bottom_value_0 = value_padding_bottom_value as string + valueSerializer.writeString(value_padding_bottom_value_0) + } + else if (RuntimeType.NUMBER == value_padding_bottom_value_type) { + valueSerializer.writeInt8(1) + const value_padding_bottom_value_1 = value_padding_bottom_value as number + valueSerializer.writeNumber(value_padding_bottom_value_1) + } + else if (RuntimeType.OBJECT == value_padding_bottom_value_type) { + valueSerializer.writeInt8(2) + const value_padding_bottom_value_2 = value_padding_bottom_value as Resource + valueSerializer.writeResource(value_padding_bottom_value_2) + } + } + const value_padding_left = value_padding.left + let value_padding_left_type : int32 = RuntimeType.UNDEFINED + value_padding_left_type = runtimeType(value_padding_left) + valueSerializer.writeInt8(value_padding_left_type) + if ((RuntimeType.UNDEFINED) != (value_padding_left_type)) { + const value_padding_left_value = value_padding_left! + let value_padding_left_value_type : int32 = RuntimeType.UNDEFINED + value_padding_left_value_type = runtimeType(value_padding_left_value) + if (RuntimeType.STRING == value_padding_left_value_type) { + valueSerializer.writeInt8(0) + const value_padding_left_value_0 = value_padding_left_value as string + valueSerializer.writeString(value_padding_left_value_0) + } + else if (RuntimeType.NUMBER == value_padding_left_value_type) { + valueSerializer.writeInt8(1) + const value_padding_left_value_1 = value_padding_left_value as number + valueSerializer.writeNumber(value_padding_left_value_1) + } + else if (RuntimeType.OBJECT == value_padding_left_value_type) { + valueSerializer.writeInt8(2) + const value_padding_left_value_2 = value_padding_left_value as Resource + valueSerializer.writeResource(value_padding_left_value_2) + } + } + } public writeGestureEvent(value: GestureEvent): void { let valueSerializer : Serializer = this valueSerializer.writePointer(toPeerPtr(value)) diff --git a/arkoala-arkts/arkui/src/generated/static_components.ts b/arkoala-arkts/arkui/src/generated/static_components.ts index 5ae023ab9..d296c5e48 100644 --- a/arkoala-arkts/arkui/src/generated/static_components.ts +++ b/arkoala-arkts/arkui/src/generated/static_components.ts @@ -24,6 +24,8 @@ import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./../CallbackTransformer" +import { GeometryInfo, Measurable, Layoutable, SizeResult } from "./common" +import { ConstraintSizeOptions } from "./units" import { UICommonBase, AttributeModifier } from "./../handwritten" import { NodeAttach, remember } from "@koalaui/runtime" export class ArkRootPeer extends PeerNode { @@ -50,6 +52,30 @@ export class ArkComponentRootPeer extends PeerNode { return _peer } } +export class ArkCustomLayoutRootPeer extends PeerNode { + protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { + super(peerPtr, id, name, flags) + } + public static create(component?: ComponentBase, flags: int32 = 0): ArkCustomLayoutRootPeer { + const peerId = PeerNode.nextId() + const _peerPtr = ArkUIGeneratedNativeModule._CustomLayoutRoot_construct(peerId, flags) + const _peer = new ArkCustomLayoutRootPeer(_peerPtr, peerId, "CustomLayoutRoot", flags) + component?.setPeer(_peer) + return _peer + } + subscribeOnMeasureSizeAttribute(value: Callback_onMeasureSize_SizeResult): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + ArkUIGeneratedNativeModule._CustomLayoutRoot_subscribeOnMeasureSize(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } + subscribeOnPlaceChildrenAttribute(value: Callback_onPlaceChildren_Void): void { + const thisSerializer : Serializer = Serializer.hold() + thisSerializer.holdAndWriteCallback(value) + ArkUIGeneratedNativeModule._CustomLayoutRoot_subscribeOnPlaceChildren(this.peer.ptr, thisSerializer.asBuffer(), thisSerializer.length()) + thisSerializer.release() + } +} export interface Root { attributeModifier(value: AttributeModifier | undefined): this } @@ -74,6 +100,34 @@ export class ArkComponentRootStyle implements ComponentRoot { throw new Error("Not implemented") } } +export type Callback_onMeasureSize_SizeResult = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => SizeResult; +export type Callback_onPlaceChildren_Void = (selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions) => void; +export interface CustomLayoutRoot { + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + attributeModifier(value: AttributeModifier | undefined): this +} +export interface UICustomLayoutRoot { + /** @memo */ + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this + /** @memo */ + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this + /** @memo */ + attributeModifier(value: AttributeModifier | undefined): this +} +export class ArkCustomLayoutRootStyle implements CustomLayoutRoot { + subscribeOnMeasureSize_value?: Callback_onMeasureSize_SizeResult + subscribeOnPlaceChildren_value?: Callback_onPlaceChildren_Void + public subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this { + return this + } + public subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this { + return this + } + public attributeModifier(value: AttributeModifier | undefined): this { + throw new Error("Not implemented") + } +} /** @memo:stable */ export class ArkRootComponent extends ComponentBase implements UIRoot { getPeer(): ArkRootPeer { @@ -104,3 +158,36 @@ export class ArkComponentRootComponent extends ComponentBase implements UICompon super.applyAttributesFinish() } } +/** @memo:stable */ +export class ArkCustomLayoutRootComponent extends ComponentBase implements UICustomLayoutRoot { + getPeer(): ArkCustomLayoutRootPeer { + return (this.peer as ArkCustomLayoutRootPeer) + } + /** @memo */ + public subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): this { + if (this.checkPriority("subscribeOnMeasureSize")) { + const value_casted = value as (Callback_onMeasureSize_SizeResult) + this.getPeer()?.subscribeOnMeasureSizeAttribute(value_casted) + return this + } + return this + } + /** @memo */ + public subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): this { + if (this.checkPriority("subscribeOnPlaceChildren")) { + const value_casted = value as (Callback_onPlaceChildren_Void) + this.getPeer()?.subscribeOnPlaceChildrenAttribute(value_casted) + return this + } + return this + } + /** @memo */ + public attributeModifier(value: AttributeModifier | undefined): this { + console.log("attributeModifier() not implemented") + return this + } + public applyAttributesFinish(): void { + // we call this function outside of class, so need to make it public + super.applyAttributesFinish() + } +} diff --git a/arkoala-arkts/arkui/src/generated/ts/type_check.ts b/arkoala-arkts/arkui/src/generated/ts/type_check.ts index f400b7e4f..a77103e95 100644 --- a/arkoala-arkts/arkui/src/generated/ts/type_check.ts +++ b/arkoala-arkts/arkui/src/generated/ts/type_check.ts @@ -19,7 +19,7 @@ import { KBoolean, KStringPtr, NativeBuffer, MaterializedBase } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { AccessibilityHoverType, Alignment, AnimationStatus, AppRotation, ArrowPointPosition, Axis, AxisAction, AxisModel, BarState, BorderStyle, CheckBoxShape, ClickEffectLevel, Color, ColoringStrategy, CopyOptions, CrownAction, CrownSensitivity, Curve, DialogButtonStyle, Direction, DividerMode, Edge, EdgeEffect, EmbeddedType, FillMode, FlexAlign, FlexDirection, FlexWrap, FocusDrawLevel, FoldStatus, FontWeight, FunctionKey, GradientDirection, HeightBreakpoint, HitTestMode, HorizontalAlign, HoverEffect, IlluminatedType, ImageFit, ImageRepeat, ImageSize, ImageSpanAlignment, InteractionHand, ItemAlign, KeySource, KeyType, LineBreakStrategy, LineCapStyle, LineJoinStyle, MarqueeUpdateStrategy, ModifierKey, MouseAction, MouseButton, NestedScrollMode, ObscuredReasons, OptionWidthMode, PageFlipMode, PixelRoundCalcPolicy, PixelRoundMode, Placement, PlayMode, RelateType, RenderFit, ResponseType, ScrollSource, TextAlign, SharedTransitionEffectType, TextOverflow, TextContentStyle, TextHeightAdaptivePolicy, WordBreak, TextCase, TextSelectableMode, TitleHeight, TouchType, TransitionType, VerticalAlign, Visibility, Week, WidthBreakpoint, XComponentType } from "./../enums" -import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, Measurable, MeasureResult, SizeResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild, Layoutable } from "./../common" +import { AccessibilityRoleType, AccessibilitySamePageMode, AdaptiveColor, CommonMethod, BlurStyle, BlendApplyType, BlurStyleActivePolicy, PickerTextStyle, ChainStyle, ContentClipMode, DismissReason, DragBehavior, DragEvent, DragResult, Rectangle, DataSyncOptions, DraggingSizeChangeEffect, DragPreviewMode, DrawModifier, EffectEdge, EffectType, FinishCallbackType, GestureModifier, UIGestureEvent, ScrollableCommonMethod, ItemDragInfo, CustomBuilder, NestedScrollOptions, EdgeEffectOptions, HapticFeedbackMode, HoverModeAreaType, ICurve, KeyboardAvoidMode, LayoutPolicy, LayoutSafeAreaEdge, LayoutSafeAreaType, ChildrenMainSize, RectResult, Literal_Boolean_isVisible, MenuPolicy, MenuPreviewMode, ModalTransition, OutlineStyle, PixelMapMock, PopupStateChangeParam, PreDragStatus, ProgressMask, RepeatMode, SelectionOptions, SafeAreaEdge, SafeAreaType, ScrollSizeMode, TextDecorationOptions, TextContentControllerBase, ShadowStyle, ShadowType, SheetKeyboardAvoidMode, SheetMode, SheetSize, SheetType, SizeResult, SourceTool, SourceType, BackgroundEffectOptions, BackgroundBlurStyleOptions, TranslateOptions, InputCounterOptions, ShadowOptions, CaretOffset, TextContentControllerOptions, ThemeColorMode, TouchTestInfo, TouchTestStrategy, TransitionEdge, TransitionEffect, TransitionEffects, RotateOptions, ScaleOptions, AnimateParam, TransitionHierarchyStrategy, UICommonEvent, Callback_ClickEvent_Void, ClickEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, HoverCallback, HoverEvent, Callback_MouseEvent_Void, MouseEvent, SizeChangeCallback, VisibleAreaEventOptions, VisibleAreaChangeCallback, SheetOptions, View, Callback_KeyEvent_Boolean, Measurable, Layoutable, BackgroundBrightnessOptions, BackgroundImageOptions, BlurOptions, ClickEffect, CrownEvent, DateRange, DismissContentCoverAction, DismissPopupAction, DismissSheetAction, DragInteractionOptions, DragItemInfo, DropOptions, ExpectedFrameRateRange, FocusMovement, ForegroundEffectOptions, GeometryTransitionOptions, InvertOptions, Tuple_ResourceColor_Number, LinearGradient_common, FractionStop, LinearGradientBlurOptions, LinearGradientOptions, Literal_Alignment_align, Literal_Number_offset_span, Literal_String_anchor_HorizontalAlign_align, Literal_String_anchor_VerticalAlign_align, Literal_String_value_Callback_Void_action, Literal_TransitionEffect_appear_disappear, LocalizedHorizontalAlignParam, LocalizedVerticalAlignParam, MeasureResult, MotionBlurAnchor, MotionBlurOptions, MotionPathOptions, OverlayOffset, PixelRoundPolicy, PreviewConfiguration, SheetDismiss, SpringBackAction, StateStyles, SystemAdaptiveOptions, TouchObject, TouchResult, AlignRuleOption, BlurStyleOptions, ContentCoverOptions, BindOptions, Callback_DismissContentCoverAction_Void, ContextMenuAnimationOptions, MultiShadowOptions, DragPreviewOptions, FadingEdgeOptions, ForegroundBlurStyleOptions, HistoricalPoint, LightSource, Literal_ResourceColor_color, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, LocalizedAlignRuleOptions, MenuElement, OverlayOptions, ReuseOptions, ReuseIdCallback, sharedTransitionOptions, SheetTitleOptions, TransitionOptions, PixelStretchEffectOptions, PointLightStyle, RadialGradientOptions, Tuple_Length_Length, SweepGradientOptions, TipsOptions, BorderImageOption, ContextMenuOptions, BorderRadiusType, CustomPopupOptions, Callback_Literal_Boolean_isVisible_Void, Callback_DismissPopupAction_Void, EventTarget, FocusAxisEvent, BaseEvent, GeometryInfo, MenuOptions, PickerDialogButtonStyle, PopupMessageOptions, Type_SheetOptions_detents, Callback_SheetDismiss_Void, Callback_DismissSheetAction_Void, Callback_SpringBackAction_Void, Callback_SheetType_Void, AccessibilityHoverEvent, AxisEvent, PopupOptions, NavDestinationInfo, NavigationInfo, RouterPageInfo, Theme, PromptActionDialogController, LayoutChild } from "./../common" import { Affinity, EllipsisMode, FontStyle, FontWidth, TextBox, LineMetrics, TextBaseline, TextDecorationStyle, TextDecorationType, TextDirection, FontFeature, FontVariation, RunMetrics, RectStyle, Decoration, TextShadow, text } from "./../arkui-graphics-text" import { AlphabetIndexerAttribute, Callback_Number_Void, OnAlphabetIndexerSelectCallback, OnAlphabetIndexerRequestPopupDataCallback, OnAlphabetIndexerPopupSelectCallback, IndexerAlign, Callback_Opt_Number_Void, AlphabetIndexerOptions } from "./../alphabet_indexer" import { ResourceColor, Font, Position, Length, SizeOptions, Offset, ColorFilter, ResourceStr, Dimension, LengthConstrain, VoidCallback, DividerStyleOptions, ConstraintSizeOptions, AccessibilityOptions, Bias, ChainWeightOptions, DirectionalEdgesT, EdgeOutlineStyles, VP, EdgeColors, LocalizedBorderRadiuses, LocalizedEdgeColors, LocalizedEdges, LocalizedEdgeWidths, LocalizedPadding, LocalizedPosition, BorderRadiuses, EdgeOutlineWidths, EdgeWidths, PX, LPX, MarkStyle, OutlineRadiuses, Padding, Area, BorderOptions, OutlineOptions } from "./../units" @@ -5981,6 +5981,20 @@ export class TypeChecker { static isGaugeShadowOptions(value: Object | string | number | undefined | boolean): boolean { throw new Error("Can not discriminate value typeof GaugeShadowOptions") } + static isGeometryInfo(value: Object | string | number | undefined | boolean, duplicated_borderWidth: boolean, duplicated_margin: boolean, duplicated_padding: boolean): boolean { + if ((!duplicated_borderWidth) && (value?.hasOwnProperty("borderWidth"))) { + return true + } + else if ((!duplicated_margin) && (value?.hasOwnProperty("margin"))) { + return true + } + else if ((!duplicated_padding) && (value?.hasOwnProperty("padding"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof GeometryInfo") + } + } static isGeometryTransitionOptions(value: Object | string | number | undefined | boolean, duplicated_follow: boolean, duplicated_hierarchyStrategy: boolean): boolean { if ((!duplicated_follow) && (value?.hasOwnProperty("follow"))) { return true @@ -7609,6 +7623,17 @@ export class TypeChecker { static isLayeredDrawableDescriptor(value: Object | string | number | undefined | boolean): boolean { throw new Error("Can not discriminate value typeof LayeredDrawableDescriptor") } + static isLayoutable(value: Object | string | number | undefined | boolean, duplicated_measureResult: boolean, duplicated_uniqueId: boolean): boolean { + if ((!duplicated_measureResult) && (value?.hasOwnProperty("measureResult"))) { + return true + } + else if ((!duplicated_uniqueId) && (value?.hasOwnProperty("uniqueId"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof Layoutable") + } + } static isLayoutDirection(value: Object | string | number | undefined | boolean): boolean { if ((value) === (LayoutDirection.LTR)) { return true @@ -14737,6 +14762,17 @@ export class TypeChecker { throw new Error("Can not discriminate value typeof SizeOptions") } } + static isSizeResult(value: Object | string | number | undefined | boolean, duplicated_width: boolean, duplicated_height: boolean): boolean { + if ((!duplicated_width) && (value?.hasOwnProperty("width"))) { + return true + } + else if ((!duplicated_height) && (value?.hasOwnProperty("height"))) { + return true + } + else { + throw new Error("Can not discriminate value typeof SizeResult") + } + } static isSizeType(value: Object | string | number | undefined | boolean): boolean { if ((value) === (SizeType.Auto)) { return true @@ -21710,6 +21746,12 @@ export class TypeChecker { static isArray_TouchTestInfo(value: Object | string | number | undefined): boolean { return Array.isArray(value) } + static isArray_Measurable(value: Object | string | number | undefined): boolean { + return Array.isArray(value) + } + static isArray_Layoutable(value: Object | string | number | undefined): boolean { + return Array.isArray(value) + } static isArray_NavDestinationTransition(value: Object | string | number | undefined): boolean { return Array.isArray(value) } @@ -21821,12 +21863,6 @@ export class TypeChecker { static isArray_LayoutChild(value: Object | string | number | undefined): boolean { return Array.isArray(value) } - static isArray_Layoutable(value: Object | string | number | undefined): boolean { - return Array.isArray(value) - } - static isArray_Measurable(value: Object | string | number | undefined): boolean { - return Array.isArray(value) - } static isArray_Tuple_Union_ResourceColor_LinearGradient_Number(value: Object | string | number | undefined): boolean { return Array.isArray(value) } diff --git a/arkoala-arkts/arkui/types/index-full.d.ts b/arkoala-arkts/arkui/types/index-full.d.ts index 9cfd8a7a6..0689c34dc 100644 --- a/arkoala-arkts/arkui/types/index-full.d.ts +++ b/arkoala-arkts/arkui/types/index-full.d.ts @@ -1478,6 +1478,12 @@ declare interface Root { } declare interface ComponentRoot { } +declare type Callback_onMeasureSize_SizeResult = ((selfLayoutInfo: GeometryInfo, children: Measurable[], constraint: ConstraintSizeOptions) => SizeResult); +declare type Callback_onPlaceChildren_Void = ((selfLayoutInfo: GeometryInfo, children: Layoutable[], constraint: ConstraintSizeOptions) => void); +declare interface CustomLayoutRoot { + subscribeOnMeasureSize(value: Callback_onMeasureSize_SizeResult): CustomLayoutRoot; + subscribeOnPlaceChildren(value: Callback_onPlaceChildren_Void): CustomLayoutRoot; +} declare class EventEmulator { static emitClickEvent(node: number|bigint, event: ClickEvent): void; static emitTextInputEvent(node: number|bigint, text: string): void; @@ -3451,7 +3457,12 @@ declare interface GeometryInfo extends SizeResult { padding: Padding; } declare interface Layoutable { - stub: string; + measureResult: MeasureResult; + uniqueId?: number; + layout(position: Position): void; + getMargin(): DirectionalEdgesT; + getPadding(): DirectionalEdgesT; + getBorderWidth(): DirectionalEdgesT; } declare interface Measurable { uniqueId?: number; diff --git a/arkoala-arkts/framework/native/src/generated/Serializers.h b/arkoala-arkts/framework/native/src/generated/Serializers.h index dde875a59..a160cbf3a 100644 --- a/arkoala-arkts/framework/native/src/generated/Serializers.h +++ b/arkoala-arkts/framework/native/src/generated/Serializers.h @@ -11443,6 +11443,41 @@ inline Ark_RuntimeType runtimeType(const Opt_Size& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Ark_SizeResult& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Ark_SizeResult* value) { + result->append("{"); + // Ark_Number width + result->append(".width="); + WriteToString(result, &value->width); + // Ark_Number height + result->append(", "); + result->append(".height="); + WriteToString(result, &value->height); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_SizeResult* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_SizeResult& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Ark_SizeType& value) { return INTEROP_RUNTIME_NUMBER; @@ -17964,6 +17999,46 @@ inline Ark_RuntimeType runtimeType(const Opt_Array_ImageFrameInfo& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Array_Layoutable& value) +{ + return INTEROP_RUNTIME_OBJECT; +} + +template <> +void WriteToString(std::string* result, const Ark_Layoutable value); + +template <> +inline void WriteToString(std::string* result, const Array_Layoutable* value) { + int32_t count = value->length; + result->append("{.array=allocArray({{"); + for (int i = 0; i < count; i++) { + if (i > 0) result->append(", "); + WriteToString(result, value->array[i]); + } + result->append("}})"); + result->append(", .length="); + result->append(std::to_string(value->length)); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_Array_Layoutable* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Array_Layoutable& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Array_LayoutSafeAreaEdge& value) { return INTEROP_RUNTIME_OBJECT; @@ -18164,6 +18239,46 @@ inline Ark_RuntimeType runtimeType(const Opt_Array_LocalizedBarrierStyle& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Array_Measurable& value) +{ + return INTEROP_RUNTIME_OBJECT; +} + +template <> +void WriteToString(std::string* result, const Ark_Measurable value); + +template <> +inline void WriteToString(std::string* result, const Array_Measurable* value) { + int32_t count = value->length; + result->append("{.array=allocArray({{"); + for (int i = 0; i < count; i++) { + if (i > 0) result->append(", "); + WriteToString(result, value->array[i]); + } + result->append("}})"); + result->append(", .length="); + result->append(std::to_string(value->length)); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_Array_Measurable* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Array_Measurable& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Array_MenuElement& value) { return INTEROP_RUNTIME_OBJECT; @@ -23308,6 +23423,37 @@ inline Ark_RuntimeType runtimeType(const Opt_Callback_OnLoadInterceptEvent_Boole return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Callback_onMeasureSize_SizeResult& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Callback_onMeasureSize_SizeResult* value) { + result->append("{"); + result->append(".resource="); + WriteToString(result, &value->resource); + result->append(", .call=0"); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_Callback_onMeasureSize_SizeResult* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Callback_onMeasureSize_SizeResult& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Callback_OnOverScrollEvent_Void& value) { return INTEROP_RUNTIME_OBJECT; @@ -23463,6 +23609,37 @@ inline Ark_RuntimeType runtimeType(const Opt_Callback_OnPermissionRequestEvent_V return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Callback_onPlaceChildren_Void& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Callback_onPlaceChildren_Void* value) { + result->append("{"); + result->append(".resource="); + WriteToString(result, &value->resource); + result->append(", .call=0"); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_Callback_onPlaceChildren_Void* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Callback_onPlaceChildren_Void& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Callback_OnProgressChangeEvent_Void& value) { return INTEROP_RUNTIME_OBJECT; @@ -24734,6 +24911,37 @@ inline Ark_RuntimeType runtimeType(const Opt_Callback_SheetType_Void& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Callback_SizeResult_Void& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Callback_SizeResult_Void* value) { + result->append("{"); + result->append(".resource="); + WriteToString(result, &value->resource); + result->append(", .call=0"); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_Callback_SizeResult_Void* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Callback_SizeResult_Void& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Callback_SpringBackAction_Void& value) { return INTEROP_RUNTIME_OBJECT; @@ -46961,6 +47169,33 @@ inline Ark_RuntimeType runtimeType(const Opt_JavaScriptProxy& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Ark_Layoutable& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Ark_Layoutable value) { + WriteToString(result, static_cast(value)); +} +template <> +inline void WriteToString(std::string* result, const Opt_Layoutable* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_Layoutable& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Ark_Length& value) { switch (value.selector) { @@ -57694,6 +57929,53 @@ inline Ark_RuntimeType runtimeType(const Opt_FocusAxisEvent& value) return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); } template <> +inline Ark_RuntimeType runtimeType(const Ark_GeometryInfo& value) +{ + return INTEROP_RUNTIME_OBJECT; +} +template <> +inline void WriteToString(std::string* result, const Ark_GeometryInfo* value) { + result->append("{"); + // Ark_Number width + result->append(".width="); + WriteToString(result, &value->width); + // Ark_Number height + result->append(", "); + result->append(".height="); + WriteToString(result, &value->height); + // Ark_EdgeWidths borderWidth + result->append(", "); + result->append(".borderWidth="); + WriteToString(result, &value->borderWidth); + // Ark_Padding margin + result->append(", "); + result->append(".margin="); + WriteToString(result, &value->margin); + // Ark_Padding padding + result->append(", "); + result->append(".padding="); + WriteToString(result, &value->padding); + result->append("}"); +} +template <> +inline void WriteToString(std::string* result, const Opt_GeometryInfo* value) { + result->append("{.tag="); + result->append(tagNameExact((Ark_Tag)(value->tag))); + result->append(", .value="); + if (value->tag != INTEROP_TAG_UNDEFINED) { + WriteToString(result, &value->value); + } else { + Ark_Undefined undefined = { 0 }; + WriteToString(result, undefined); + } + result->append("}"); +} +template <> +inline Ark_RuntimeType runtimeType(const Opt_GeometryInfo& value) +{ + return (value.tag != INTEROP_TAG_UNDEFINED) ? (INTEROP_RUNTIME_OBJECT) : (INTEROP_RUNTIME_UNDEFINED); +} +template <> inline Ark_RuntimeType runtimeType(const Ark_GestureEvent& value) { return INTEROP_RUNTIME_OBJECT; @@ -62792,6 +63074,14 @@ class Serializer : public SerializerBase { const auto value_height = value.height; valueSerializer.writeNumber(value_height); } + void writeSizeResult(Ark_SizeResult value) + { + Serializer& valueSerializer = *this; + const auto value_width = value.width; + valueSerializer.writeNumber(value_width); + const auto value_height = value.height; + valueSerializer.writeNumber(value_height); + } void writeSliderAttribute(Ark_SliderAttribute value) { } @@ -73122,6 +73412,11 @@ class Serializer : public SerializerBase { valueSerializer.writeString(value_permission_value); } } + void writeLayoutable(Ark_Layoutable value) + { + Serializer& valueSerializer = *this; + valueSerializer.writePointer(value); + } void writeLengthConstrain(Ark_LengthConstrain value) { Serializer& valueSerializer = *this; @@ -85829,6 +86124,115 @@ class Serializer : public SerializerBase { Serializer& valueSerializer = *this; valueSerializer.writePointer(value); } + void writeGeometryInfo(Ark_GeometryInfo value) + { + Serializer& valueSerializer = *this; + const auto value_width = value.width; + valueSerializer.writeNumber(value_width); + const auto value_height = value.height; + valueSerializer.writeNumber(value_height); + const auto value_borderWidth = value.borderWidth; + valueSerializer.writeEdgeWidths(value_borderWidth); + const auto value_margin = value.margin; + valueSerializer.writePadding(value_margin); + const auto value_padding = value.padding; + const auto value_padding_top = value_padding.top; + Ark_Int32 value_padding_top_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_top_type = runtimeType(value_padding_top); + valueSerializer.writeInt8(value_padding_top_type); + if ((INTEROP_RUNTIME_UNDEFINED) != (value_padding_top_type)) { + const auto value_padding_top_value = value_padding_top.value; + Ark_Int32 value_padding_top_value_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_top_value_type = value_padding_top_value.selector; + if (value_padding_top_value_type == 0) { + valueSerializer.writeInt8(0); + const auto value_padding_top_value_0 = value_padding_top_value.value0; + valueSerializer.writeString(value_padding_top_value_0); + } + else if (value_padding_top_value_type == 1) { + valueSerializer.writeInt8(1); + const auto value_padding_top_value_1 = value_padding_top_value.value1; + valueSerializer.writeNumber(value_padding_top_value_1); + } + else if (value_padding_top_value_type == 2) { + valueSerializer.writeInt8(2); + const auto value_padding_top_value_2 = value_padding_top_value.value2; + valueSerializer.writeResource(value_padding_top_value_2); + } + } + const auto value_padding_right = value_padding.right; + Ark_Int32 value_padding_right_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_right_type = runtimeType(value_padding_right); + valueSerializer.writeInt8(value_padding_right_type); + if ((INTEROP_RUNTIME_UNDEFINED) != (value_padding_right_type)) { + const auto value_padding_right_value = value_padding_right.value; + Ark_Int32 value_padding_right_value_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_right_value_type = value_padding_right_value.selector; + if (value_padding_right_value_type == 0) { + valueSerializer.writeInt8(0); + const auto value_padding_right_value_0 = value_padding_right_value.value0; + valueSerializer.writeString(value_padding_right_value_0); + } + else if (value_padding_right_value_type == 1) { + valueSerializer.writeInt8(1); + const auto value_padding_right_value_1 = value_padding_right_value.value1; + valueSerializer.writeNumber(value_padding_right_value_1); + } + else if (value_padding_right_value_type == 2) { + valueSerializer.writeInt8(2); + const auto value_padding_right_value_2 = value_padding_right_value.value2; + valueSerializer.writeResource(value_padding_right_value_2); + } + } + const auto value_padding_bottom = value_padding.bottom; + Ark_Int32 value_padding_bottom_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_bottom_type = runtimeType(value_padding_bottom); + valueSerializer.writeInt8(value_padding_bottom_type); + if ((INTEROP_RUNTIME_UNDEFINED) != (value_padding_bottom_type)) { + const auto value_padding_bottom_value = value_padding_bottom.value; + Ark_Int32 value_padding_bottom_value_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_bottom_value_type = value_padding_bottom_value.selector; + if (value_padding_bottom_value_type == 0) { + valueSerializer.writeInt8(0); + const auto value_padding_bottom_value_0 = value_padding_bottom_value.value0; + valueSerializer.writeString(value_padding_bottom_value_0); + } + else if (value_padding_bottom_value_type == 1) { + valueSerializer.writeInt8(1); + const auto value_padding_bottom_value_1 = value_padding_bottom_value.value1; + valueSerializer.writeNumber(value_padding_bottom_value_1); + } + else if (value_padding_bottom_value_type == 2) { + valueSerializer.writeInt8(2); + const auto value_padding_bottom_value_2 = value_padding_bottom_value.value2; + valueSerializer.writeResource(value_padding_bottom_value_2); + } + } + const auto value_padding_left = value_padding.left; + Ark_Int32 value_padding_left_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_left_type = runtimeType(value_padding_left); + valueSerializer.writeInt8(value_padding_left_type); + if ((INTEROP_RUNTIME_UNDEFINED) != (value_padding_left_type)) { + const auto value_padding_left_value = value_padding_left.value; + Ark_Int32 value_padding_left_value_type = INTEROP_RUNTIME_UNDEFINED; + value_padding_left_value_type = value_padding_left_value.selector; + if (value_padding_left_value_type == 0) { + valueSerializer.writeInt8(0); + const auto value_padding_left_value_0 = value_padding_left_value.value0; + valueSerializer.writeString(value_padding_left_value_0); + } + else if (value_padding_left_value_type == 1) { + valueSerializer.writeInt8(1); + const auto value_padding_left_value_1 = value_padding_left_value.value1; + valueSerializer.writeNumber(value_padding_left_value_1); + } + else if (value_padding_left_value_type == 2) { + valueSerializer.writeInt8(2); + const auto value_padding_left_value_2 = value_padding_left_value.value2; + valueSerializer.writeResource(value_padding_left_value_2); + } + } + } void writeGestureEvent(Ark_GestureEvent value) { Serializer& valueSerializer = *this; @@ -92703,6 +93107,14 @@ class Deserializer : public DeserializerBase { value.height = static_cast(valueDeserializer.readNumber()); return value; } + Ark_SizeResult readSizeResult() + { + Ark_SizeResult value = {}; + Deserializer& valueDeserializer = *this; + value.width = static_cast(valueDeserializer.readNumber()); + value.height = static_cast(valueDeserializer.readNumber()); + return value; + } Ark_SliderAttribute readSliderAttribute() { Ark_SliderAttribute value = {}; @@ -103592,6 +104004,12 @@ class Deserializer : public DeserializerBase { value.permission = permission_buf; return value; } + Ark_Layoutable readLayoutable() + { + Deserializer& valueDeserializer = *this; + Ark_NativePointer ptr = valueDeserializer.readPointer(); + return static_cast(ptr); + } Ark_LengthConstrain readLengthConstrain() { Ark_LengthConstrain value = {}; @@ -117298,6 +117716,122 @@ class Deserializer : public DeserializerBase { Ark_NativePointer ptr = valueDeserializer.readPointer(); return static_cast(ptr); } + Ark_GeometryInfo readGeometryInfo() + { + Ark_GeometryInfo value = {}; + Deserializer& valueDeserializer = *this; + value.width = static_cast(valueDeserializer.readNumber()); + value.height = static_cast(valueDeserializer.readNumber()); + value.borderWidth = valueDeserializer.readEdgeWidths(); + value.margin = valueDeserializer.readPadding(); + Ark_Padding padding_buf = {}; + const auto padding_buf_top_buf_runtimeType = static_cast(valueDeserializer.readInt8()); + Opt_Length padding_buf_top_buf = {}; + padding_buf_top_buf.tag = padding_buf_top_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (padding_buf_top_buf_runtimeType)) + { + const Ark_Int8 padding_buf_top_buf__selector = valueDeserializer.readInt8(); + Ark_Length padding_buf_top_buf_ = {}; + padding_buf_top_buf_.selector = padding_buf_top_buf__selector; + if (padding_buf_top_buf__selector == 0) { + padding_buf_top_buf_.selector = 0; + padding_buf_top_buf_.value0 = static_cast(valueDeserializer.readString()); + } + else if (padding_buf_top_buf__selector == 1) { + padding_buf_top_buf_.selector = 1; + padding_buf_top_buf_.value1 = static_cast(valueDeserializer.readNumber()); + } + else if (padding_buf_top_buf__selector == 2) { + padding_buf_top_buf_.selector = 2; + padding_buf_top_buf_.value2 = valueDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for padding_buf_top_buf_ has to be chosen through deserialisation."); + } + padding_buf_top_buf.value = static_cast(padding_buf_top_buf_); + } + padding_buf.top = padding_buf_top_buf; + const auto padding_buf_right_buf_runtimeType = static_cast(valueDeserializer.readInt8()); + Opt_Length padding_buf_right_buf = {}; + padding_buf_right_buf.tag = padding_buf_right_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (padding_buf_right_buf_runtimeType)) + { + const Ark_Int8 padding_buf_right_buf__selector = valueDeserializer.readInt8(); + Ark_Length padding_buf_right_buf_ = {}; + padding_buf_right_buf_.selector = padding_buf_right_buf__selector; + if (padding_buf_right_buf__selector == 0) { + padding_buf_right_buf_.selector = 0; + padding_buf_right_buf_.value0 = static_cast(valueDeserializer.readString()); + } + else if (padding_buf_right_buf__selector == 1) { + padding_buf_right_buf_.selector = 1; + padding_buf_right_buf_.value1 = static_cast(valueDeserializer.readNumber()); + } + else if (padding_buf_right_buf__selector == 2) { + padding_buf_right_buf_.selector = 2; + padding_buf_right_buf_.value2 = valueDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for padding_buf_right_buf_ has to be chosen through deserialisation."); + } + padding_buf_right_buf.value = static_cast(padding_buf_right_buf_); + } + padding_buf.right = padding_buf_right_buf; + const auto padding_buf_bottom_buf_runtimeType = static_cast(valueDeserializer.readInt8()); + Opt_Length padding_buf_bottom_buf = {}; + padding_buf_bottom_buf.tag = padding_buf_bottom_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (padding_buf_bottom_buf_runtimeType)) + { + const Ark_Int8 padding_buf_bottom_buf__selector = valueDeserializer.readInt8(); + Ark_Length padding_buf_bottom_buf_ = {}; + padding_buf_bottom_buf_.selector = padding_buf_bottom_buf__selector; + if (padding_buf_bottom_buf__selector == 0) { + padding_buf_bottom_buf_.selector = 0; + padding_buf_bottom_buf_.value0 = static_cast(valueDeserializer.readString()); + } + else if (padding_buf_bottom_buf__selector == 1) { + padding_buf_bottom_buf_.selector = 1; + padding_buf_bottom_buf_.value1 = static_cast(valueDeserializer.readNumber()); + } + else if (padding_buf_bottom_buf__selector == 2) { + padding_buf_bottom_buf_.selector = 2; + padding_buf_bottom_buf_.value2 = valueDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for padding_buf_bottom_buf_ has to be chosen through deserialisation."); + } + padding_buf_bottom_buf.value = static_cast(padding_buf_bottom_buf_); + } + padding_buf.bottom = padding_buf_bottom_buf; + const auto padding_buf_left_buf_runtimeType = static_cast(valueDeserializer.readInt8()); + Opt_Length padding_buf_left_buf = {}; + padding_buf_left_buf.tag = padding_buf_left_buf_runtimeType == INTEROP_RUNTIME_UNDEFINED ? INTEROP_TAG_UNDEFINED : INTEROP_TAG_OBJECT; + if ((INTEROP_RUNTIME_UNDEFINED) != (padding_buf_left_buf_runtimeType)) + { + const Ark_Int8 padding_buf_left_buf__selector = valueDeserializer.readInt8(); + Ark_Length padding_buf_left_buf_ = {}; + padding_buf_left_buf_.selector = padding_buf_left_buf__selector; + if (padding_buf_left_buf__selector == 0) { + padding_buf_left_buf_.selector = 0; + padding_buf_left_buf_.value0 = static_cast(valueDeserializer.readString()); + } + else if (padding_buf_left_buf__selector == 1) { + padding_buf_left_buf_.selector = 1; + padding_buf_left_buf_.value1 = static_cast(valueDeserializer.readNumber()); + } + else if (padding_buf_left_buf__selector == 2) { + padding_buf_left_buf_.selector = 2; + padding_buf_left_buf_.value2 = valueDeserializer.readResource(); + } + else { + INTEROP_FATAL("One of the branches for padding_buf_left_buf_ has to be chosen through deserialisation."); + } + padding_buf_left_buf.value = static_cast(padding_buf_left_buf_); + } + padding_buf.left = padding_buf_left_buf; + value.padding = padding_buf; + return value; + } Ark_GestureEvent readGestureEvent() { Deserializer& valueDeserializer = *this; diff --git a/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h b/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h index b6b2bf201..566b3cc3f 100644 --- a/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h +++ b/arkoala-arkts/framework/native/src/generated/arkoala_api_generated.h @@ -607,6 +607,8 @@ typedef struct ShapeMaskPeer* Ark_ShapeMask; typedef struct Opt_ShapeMask Opt_ShapeMask; typedef struct Ark_Size Ark_Size; typedef struct Opt_Size Opt_Size; +typedef struct Ark_SizeResult Ark_SizeResult; +typedef struct Opt_SizeResult Opt_SizeResult; typedef struct Ark_SliderAttribute Ark_SliderAttribute; typedef struct Opt_SliderAttribute Opt_SliderAttribute; typedef struct SpringMotionPeer SpringMotionPeer; @@ -901,6 +903,8 @@ typedef struct Array_ImageAnalyzerType Array_ImageAnalyzerType; typedef struct Opt_Array_ImageAnalyzerType Opt_Array_ImageAnalyzerType; typedef struct Array_ImageFrameInfo Array_ImageFrameInfo; typedef struct Opt_Array_ImageFrameInfo Opt_Array_ImageFrameInfo; +typedef struct Array_Layoutable Array_Layoutable; +typedef struct Opt_Array_Layoutable Opt_Array_Layoutable; typedef struct Array_LayoutSafeAreaEdge Array_LayoutSafeAreaEdge; typedef struct Opt_Array_LayoutSafeAreaEdge Opt_Array_LayoutSafeAreaEdge; typedef struct Array_LayoutSafeAreaType Array_LayoutSafeAreaType; @@ -911,6 +915,8 @@ typedef struct Array_LengthMetrics Array_LengthMetrics; typedef struct Opt_Array_LengthMetrics Opt_Array_LengthMetrics; typedef struct Array_LocalizedBarrierStyle Array_LocalizedBarrierStyle; typedef struct Opt_Array_LocalizedBarrierStyle Opt_Array_LocalizedBarrierStyle; +typedef struct Array_Measurable Array_Measurable; +typedef struct Opt_Array_Measurable Opt_Array_Measurable; typedef struct Array_MenuElement Array_MenuElement; typedef struct Opt_Array_MenuElement Opt_Array_MenuElement; typedef struct Array_ModifierKey Array_ModifierKey; @@ -1215,6 +1221,8 @@ typedef struct Callback_OnInterceptRequestEvent_WebResourceResponse Callback_OnI typedef struct Opt_Callback_OnInterceptRequestEvent_WebResourceResponse Opt_Callback_OnInterceptRequestEvent_WebResourceResponse; typedef struct Callback_OnLoadInterceptEvent_Boolean Callback_OnLoadInterceptEvent_Boolean; typedef struct Opt_Callback_OnLoadInterceptEvent_Boolean Opt_Callback_OnLoadInterceptEvent_Boolean; +typedef struct Callback_onMeasureSize_SizeResult Callback_onMeasureSize_SizeResult; +typedef struct Opt_Callback_onMeasureSize_SizeResult Opt_Callback_onMeasureSize_SizeResult; typedef struct Callback_OnOverScrollEvent_Void Callback_OnOverScrollEvent_Void; typedef struct Opt_Callback_OnOverScrollEvent_Void Opt_Callback_OnOverScrollEvent_Void; typedef struct Callback_OnPageBeginEvent_Void Callback_OnPageBeginEvent_Void; @@ -1225,6 +1233,8 @@ typedef struct Callback_OnPageVisibleEvent_Void Callback_OnPageVisibleEvent_Void typedef struct Opt_Callback_OnPageVisibleEvent_Void Opt_Callback_OnPageVisibleEvent_Void; typedef struct Callback_OnPermissionRequestEvent_Void Callback_OnPermissionRequestEvent_Void; typedef struct Opt_Callback_OnPermissionRequestEvent_Void Opt_Callback_OnPermissionRequestEvent_Void; +typedef struct Callback_onPlaceChildren_Void Callback_onPlaceChildren_Void; +typedef struct Opt_Callback_onPlaceChildren_Void Opt_Callback_onPlaceChildren_Void; typedef struct Callback_OnProgressChangeEvent_Void Callback_OnProgressChangeEvent_Void; typedef struct Opt_Callback_OnProgressChangeEvent_Void Opt_Callback_OnProgressChangeEvent_Void; typedef struct Callback_OnPromptEvent_Boolean Callback_OnPromptEvent_Boolean; @@ -1307,6 +1317,8 @@ typedef struct Callback_SheetDismiss_Void Callback_SheetDismiss_Void; typedef struct Opt_Callback_SheetDismiss_Void Opt_Callback_SheetDismiss_Void; typedef struct Callback_SheetType_Void Callback_SheetType_Void; typedef struct Opt_Callback_SheetType_Void Opt_Callback_SheetType_Void; +typedef struct Callback_SizeResult_Void Callback_SizeResult_Void; +typedef struct Opt_Callback_SizeResult_Void Opt_Callback_SizeResult_Void; typedef struct Callback_SpringBackAction_Void Callback_SpringBackAction_Void; typedef struct Opt_Callback_SpringBackAction_Void Opt_Callback_SpringBackAction_Void; typedef struct Callback_String_Number_Void Callback_String_Number_Void; @@ -2488,6 +2500,9 @@ typedef struct Ark_ImageFrameInfo Ark_ImageFrameInfo; typedef struct Opt_ImageFrameInfo Opt_ImageFrameInfo; typedef struct Ark_JavaScriptProxy Ark_JavaScriptProxy; typedef struct Opt_JavaScriptProxy Opt_JavaScriptProxy; +typedef struct LayoutablePeer LayoutablePeer; +typedef struct LayoutablePeer* Ark_Layoutable; +typedef struct Opt_Layoutable Opt_Layoutable; typedef struct Ark_Length Ark_Length; typedef struct Opt_Length Opt_Length; typedef struct Ark_LengthConstrain Ark_LengthConstrain; @@ -2949,6 +2964,8 @@ typedef struct Opt_EventTarget Opt_EventTarget; typedef struct FocusAxisEventPeer FocusAxisEventPeer; typedef struct FocusAxisEventPeer* Ark_FocusAxisEvent; typedef struct Opt_FocusAxisEvent Opt_FocusAxisEvent; +typedef struct Ark_GeometryInfo Ark_GeometryInfo; +typedef struct Opt_GeometryInfo Opt_GeometryInfo; typedef struct GestureEventPeer GestureEventPeer; typedef struct GestureEventPeer* Ark_GestureEvent; typedef struct Opt_GestureEvent Opt_GestureEvent; @@ -7452,6 +7469,14 @@ typedef struct Opt_Size { Ark_Tag tag; Ark_Size value; } Opt_Size; +typedef struct Ark_SizeResult { + Ark_Number width; + Ark_Number height; +} Ark_SizeResult; +typedef struct Opt_SizeResult { + Ark_Tag tag; + Ark_SizeResult value; +} Opt_SizeResult; typedef struct Ark_SliderAttribute { void *handle; } Ark_SliderAttribute; @@ -8382,6 +8407,14 @@ typedef struct Opt_Array_ImageFrameInfo { Ark_Tag tag; Array_ImageFrameInfo value; } Opt_Array_ImageFrameInfo; +typedef struct Array_Layoutable { + Ark_Layoutable* array; + Ark_Int32 length; +} Array_Layoutable; +typedef struct Opt_Array_Layoutable { + Ark_Tag tag; + Array_Layoutable value; +} Opt_Array_Layoutable; typedef struct Array_LayoutSafeAreaEdge { Ark_LayoutSafeAreaEdge* array; Ark_Int32 length; @@ -8422,6 +8455,14 @@ typedef struct Opt_Array_LocalizedBarrierStyle { Ark_Tag tag; Array_LocalizedBarrierStyle value; } Opt_Array_LocalizedBarrierStyle; +typedef struct Array_Measurable { + Ark_Measurable* array; + Ark_Int32 length; +} Array_Measurable; +typedef struct Opt_Array_Measurable { + Ark_Tag tag; + Array_Measurable value; +} Opt_Array_Measurable; typedef struct Array_MenuElement { Ark_MenuElement* array; Ark_Int32 length; @@ -9742,6 +9783,15 @@ typedef struct Opt_Callback_OnLoadInterceptEvent_Boolean { Ark_Tag tag; Callback_OnLoadInterceptEvent_Boolean value; } Opt_Callback_OnLoadInterceptEvent_Boolean; +typedef struct Callback_onMeasureSize_SizeResult { + Ark_CallbackResource resource; + void (*call)(const Ark_Int32 resourceId, const Ark_GeometryInfo selfLayoutInfo, const Array_Measurable children, const Ark_ConstraintSizeOptions constraint, const Callback_SizeResult_Void continuation); + void (*callSync)(Ark_VMContext vmContext, const Ark_Int32 resourceId, const Ark_GeometryInfo selfLayoutInfo, const Array_Measurable children, const Ark_ConstraintSizeOptions constraint, const Callback_SizeResult_Void continuation); +} Callback_onMeasureSize_SizeResult; +typedef struct Opt_Callback_onMeasureSize_SizeResult { + Ark_Tag tag; + Callback_onMeasureSize_SizeResult value; +} Opt_Callback_onMeasureSize_SizeResult; typedef struct Callback_OnOverScrollEvent_Void { Ark_CallbackResource resource; void (*call)(const Ark_Int32 resourceId, const Ark_OnOverScrollEvent parameter); @@ -9787,6 +9837,15 @@ typedef struct Opt_Callback_OnPermissionRequestEvent_Void { Ark_Tag tag; Callback_OnPermissionRequestEvent_Void value; } Opt_Callback_OnPermissionRequestEvent_Void; +typedef struct Callback_onPlaceChildren_Void { + Ark_CallbackResource resource; + void (*call)(const Ark_Int32 resourceId, const Ark_GeometryInfo selfLayoutInfo, const Array_Layoutable children, const Ark_ConstraintSizeOptions constraint); + void (*callSync)(Ark_VMContext vmContext, const Ark_Int32 resourceId, const Ark_GeometryInfo selfLayoutInfo, const Array_Layoutable children, const Ark_ConstraintSizeOptions constraint); +} Callback_onPlaceChildren_Void; +typedef struct Opt_Callback_onPlaceChildren_Void { + Ark_Tag tag; + Callback_onPlaceChildren_Void value; +} Opt_Callback_onPlaceChildren_Void; typedef struct Callback_OnProgressChangeEvent_Void { Ark_CallbackResource resource; void (*call)(const Ark_Int32 resourceId, const Ark_OnProgressChangeEvent parameter); @@ -10156,6 +10215,15 @@ typedef struct Opt_Callback_SheetType_Void { Ark_Tag tag; Callback_SheetType_Void value; } Opt_Callback_SheetType_Void; +typedef struct Callback_SizeResult_Void { + Ark_CallbackResource resource; + void (*call)(const Ark_Int32 resourceId, const Ark_SizeResult value); + void (*callSync)(Ark_VMContext vmContext, const Ark_Int32 resourceId, const Ark_SizeResult value); +} Callback_SizeResult_Void; +typedef struct Opt_Callback_SizeResult_Void { + Ark_Tag tag; + Callback_SizeResult_Void value; +} Opt_Callback_SizeResult_Void; typedef struct Callback_SpringBackAction_Void { Ark_CallbackResource resource; void (*call)(const Ark_Int32 resourceId, const Ark_SpringBackAction parameter); @@ -15500,6 +15568,10 @@ typedef struct Opt_JavaScriptProxy { Ark_Tag tag; Ark_JavaScriptProxy value; } Opt_JavaScriptProxy; +typedef struct Opt_Layoutable { + Ark_Tag tag; + Ark_Layoutable value; +} Opt_Layoutable; typedef struct Ark_Length { Ark_Int32 selector; union { @@ -18020,6 +18092,17 @@ typedef struct Opt_FocusAxisEvent { Ark_Tag tag; Ark_FocusAxisEvent value; } Opt_FocusAxisEvent; +typedef struct Ark_GeometryInfo { + Ark_Number width; + Ark_Number height; + Ark_EdgeWidths borderWidth; + Ark_Padding margin; + Ark_Padding padding; +} Ark_GeometryInfo; +typedef struct Opt_GeometryInfo { + Ark_Tag tag; + Ark_GeometryInfo value; +} Opt_GeometryInfo; typedef struct Opt_GestureEvent { Ark_Tag tag; Ark_GestureEvent value; @@ -19032,6 +19115,15 @@ typedef struct GENERATED_ArkUIComponentRootModifier { Ark_Int32 flags); } GENERATED_ArkUIComponentRootModifier; +typedef struct GENERATED_ArkUICustomLayoutRootModifier { + Ark_NativePointer (*construct)(Ark_Int32 id, + Ark_Int32 flags); + void (*setSubscribeOnMeasureSize)(Ark_NativePointer node, + const Callback_onMeasureSize_SizeResult* value); + void (*setSubscribeOnPlaceChildren)(Ark_NativePointer node, + const Callback_onPlaceChildren_Void* value); +} GENERATED_ArkUICustomLayoutRootModifier; + typedef struct GENERATED_ArkUIAbilityComponentModifier { Ark_NativePointer (*construct)(Ark_Int32 id, Ark_Int32 flags); @@ -24418,6 +24510,23 @@ typedef struct GENERATED_ArkUIProgressMaskAccessor { Ark_Boolean value); } GENERATED_ArkUIProgressMaskAccessor; +typedef struct GENERATED_ArkUILayoutableAccessor { + void (*destroyPeer)(Ark_Layoutable peer); + Ark_Layoutable (*ctor)(); + Ark_NativePointer (*getFinalizer)(); + void (*layout)(Ark_Layoutable peer, + const Ark_Position* position); + Ark_DirectionalEdgesT (*getMargin)(Ark_Layoutable peer); + Ark_DirectionalEdgesT (*getPadding)(Ark_Layoutable peer); + Ark_DirectionalEdgesT (*getBorderWidth)(Ark_Layoutable peer); + Ark_MeasureResult (*getMeasureResult)(Ark_Layoutable peer); + void (*setMeasureResult)(Ark_Layoutable peer, + const Ark_MeasureResult* measureResult); + Opt_Number (*getUniqueId)(Ark_Layoutable peer); + void (*setUniqueId)(Ark_Layoutable peer, + const Ark_Number* uniqueId); +} GENERATED_ArkUILayoutableAccessor; + typedef struct GENERATED_ArkUIMeasurableAccessor { void (*destroyPeer)(Ark_Measurable peer); Ark_Measurable (*ctor)(); @@ -26513,6 +26622,7 @@ typedef struct GENERATED_ArkUIGlobalScopeAccessor { typedef struct GENERATED_ArkUINodeModifiers { const GENERATED_ArkUIRootModifier* (*getRootModifier)(); const GENERATED_ArkUIComponentRootModifier* (*getComponentRootModifier)(); + const GENERATED_ArkUICustomLayoutRootModifier* (*getCustomLayoutRootModifier)(); const GENERATED_ArkUIAbilityComponentModifier* (*getAbilityComponentModifier)(); const GENERATED_ArkUIAlphabetIndexerModifier* (*getAlphabetIndexerModifier)(); const GENERATED_ArkUIAnimatorModifier* (*getAnimatorModifier)(); @@ -26700,6 +26810,7 @@ typedef struct GENERATED_ArkUIAccessors { const GENERATED_ArkUIKeyEventAccessor* (*getKeyEventAccessor)(); const GENERATED_ArkUIFocusAxisEventAccessor* (*getFocusAxisEventAccessor)(); const GENERATED_ArkUIProgressMaskAccessor* (*getProgressMaskAccessor)(); + const GENERATED_ArkUILayoutableAccessor* (*getLayoutableAccessor)(); const GENERATED_ArkUIMeasurableAccessor* (*getMeasurableAccessor)(); const GENERATED_ArkUIViewAccessor* (*getViewAccessor)(); const GENERATED_ArkUITextContentControllerBaseAccessor* (*getTextContentControllerBaseAccessor)(); @@ -26858,6 +26969,7 @@ typedef enum GENERATED_Ark_NodeType { GENERATED_ARKUI_COMPONENT_ROOT, GENERATED_ARKUI_CONTAINER_SPAN, GENERATED_ARKUI_COUNTER, + GENERATED_ARKUI_CUSTOM_LAYOUT_ROOT, GENERATED_ARKUI_DATA_PANEL, GENERATED_ARKUI_DATE_PICKER, GENERATED_ARKUI_DIVIDER, diff --git a/arkoala-arkts/framework/native/src/generated/bridge_generated.cc b/arkoala-arkts/framework/native/src/generated/bridge_generated.cc index 38b051169..c3c457dba 100644 --- a/arkoala-arkts/framework/native/src/generated/bridge_generated.cc +++ b/arkoala-arkts/framework/native/src/generated/bridge_generated.cc @@ -41,6 +41,24 @@ Ark_NativePointer impl_ComponentRoot_construct(Ark_Int32 id, Ark_Int32 flags) { return GetNodeModifiers()->getComponentRootModifier()->construct(id, flags); } KOALA_INTEROP_DIRECT_2(ComponentRoot_construct, Ark_NativePointer, Ark_Int32, Ark_Int32) +Ark_NativePointer impl_CustomLayoutRoot_construct(Ark_Int32 id, Ark_Int32 flags) { + return GetNodeModifiers()->getCustomLayoutRootModifier()->construct(id, flags); +} +KOALA_INTEROP_DIRECT_2(CustomLayoutRoot_construct, Ark_NativePointer, Ark_Int32, Ark_Int32) +void impl_CustomLayoutRoot_subscribeOnMeasureSize(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_NodeHandle self = reinterpret_cast(thisPtr); + Deserializer thisDeserializer(thisArray, thisLength); + Callback_onMeasureSize_SizeResult value_value = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_onMeasureSize_SizeResult)))), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCallerSync(Kind_Callback_onMeasureSize_SizeResult))))};; + GetNodeModifiers()->getCustomLayoutRootModifier()->setSubscribeOnMeasureSize(self, (const Callback_onMeasureSize_SizeResult*)&value_value); +} +KOALA_INTEROP_DIRECT_V3(CustomLayoutRoot_subscribeOnMeasureSize, Ark_NativePointer, KSerializerBuffer, int32_t) +void impl_CustomLayoutRoot_subscribeOnPlaceChildren(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_NodeHandle self = reinterpret_cast(thisPtr); + Deserializer thisDeserializer(thisArray, thisLength); + Callback_onPlaceChildren_Void value_value = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_onPlaceChildren_Void)))), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCallerSync(Kind_Callback_onPlaceChildren_Void))))};; + GetNodeModifiers()->getCustomLayoutRootModifier()->setSubscribeOnPlaceChildren(self, (const Callback_onPlaceChildren_Void*)&value_value); +} +KOALA_INTEROP_DIRECT_V3(CustomLayoutRoot_subscribeOnPlaceChildren, Ark_NativePointer, KSerializerBuffer, int32_t) Ark_NativePointer impl_Root_construct(Ark_Int32 id, Ark_Int32 flags) { return GetNodeModifiers()->getRootModifier()->construct(id, flags); } @@ -37755,6 +37773,79 @@ void impl_ProgressMask_enableBreathingAnimation(Ark_NativePointer thisPtr, Ark_B GetAccessors()->getProgressMaskAccessor()->enableBreathingAnimation(self, value); } KOALA_INTEROP_DIRECT_V2(ProgressMask_enableBreathingAnimation, Ark_NativePointer, Ark_Boolean) +Ark_NativePointer impl_Layoutable_ctor() { + return GetAccessors()->getLayoutableAccessor()->ctor(); +} +KOALA_INTEROP_DIRECT_0(Layoutable_ctor, Ark_NativePointer) +Ark_NativePointer impl_Layoutable_getFinalizer() { + return GetAccessors()->getLayoutableAccessor()->getFinalizer(); +} +KOALA_INTEROP_DIRECT_0(Layoutable_getFinalizer, Ark_NativePointer) +void impl_Layoutable_layout(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + Deserializer thisDeserializer(thisArray, thisLength); + Ark_Position position_value = thisDeserializer.readPosition();; + GetAccessors()->getLayoutableAccessor()->layout(self, (const Ark_Position*)&position_value); +} +KOALA_INTEROP_DIRECT_V3(Layoutable_layout, Ark_NativePointer, KSerializerBuffer, int32_t) +KInteropReturnBuffer impl_Layoutable_getMargin(Ark_NativePointer thisPtr) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + const auto &retValue = GetAccessors()->getLayoutableAccessor()->getMargin(self); + Serializer _retSerializer {}; + _retSerializer.writeDirectionalEdgesT(retValue); + return _retSerializer.toReturnBuffer(); +} +KOALA_INTEROP_1(Layoutable_getMargin, KInteropReturnBuffer, Ark_NativePointer) +KInteropReturnBuffer impl_Layoutable_getPadding(Ark_NativePointer thisPtr) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + const auto &retValue = GetAccessors()->getLayoutableAccessor()->getPadding(self); + Serializer _retSerializer {}; + _retSerializer.writeDirectionalEdgesT(retValue); + return _retSerializer.toReturnBuffer(); +} +KOALA_INTEROP_1(Layoutable_getPadding, KInteropReturnBuffer, Ark_NativePointer) +KInteropReturnBuffer impl_Layoutable_getBorderWidth(Ark_NativePointer thisPtr) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + const auto &retValue = GetAccessors()->getLayoutableAccessor()->getBorderWidth(self); + Serializer _retSerializer {}; + _retSerializer.writeDirectionalEdgesT(retValue); + return _retSerializer.toReturnBuffer(); +} +KOALA_INTEROP_1(Layoutable_getBorderWidth, KInteropReturnBuffer, Ark_NativePointer) +KInteropReturnBuffer impl_Layoutable_getMeasureResult(Ark_NativePointer thisPtr) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + const auto &retValue = GetAccessors()->getLayoutableAccessor()->getMeasureResult(self); + Serializer _retSerializer {}; + _retSerializer.writeMeasureResult(retValue); + return _retSerializer.toReturnBuffer(); +} +KOALA_INTEROP_1(Layoutable_getMeasureResult, KInteropReturnBuffer, Ark_NativePointer) +void impl_Layoutable_setMeasureResult(Ark_NativePointer thisPtr, KSerializerBuffer thisArray, int32_t thisLength) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + Deserializer thisDeserializer(thisArray, thisLength); + Ark_MeasureResult measureResult_value = thisDeserializer.readMeasureResult();; + GetAccessors()->getLayoutableAccessor()->setMeasureResult(self, (const Ark_MeasureResult*)&measureResult_value); +} +KOALA_INTEROP_DIRECT_V3(Layoutable_setMeasureResult, Ark_NativePointer, KSerializerBuffer, int32_t) +KInteropReturnBuffer impl_Layoutable_getUniqueId(Ark_NativePointer thisPtr) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + const auto &retValue = GetAccessors()->getLayoutableAccessor()->getUniqueId(self); + Serializer _retSerializer {}; + Ark_Int32 retValue_type = INTEROP_RUNTIME_UNDEFINED; + retValue_type = runtimeType(retValue); + _retSerializer.writeInt8(retValue_type); + if ((INTEROP_RUNTIME_UNDEFINED) != (retValue_type)) { + const auto retValue_value = retValue.value; + _retSerializer.writeNumber(retValue_value); + } + return _retSerializer.toReturnBuffer(); +} +KOALA_INTEROP_1(Layoutable_getUniqueId, KInteropReturnBuffer, Ark_NativePointer) +void impl_Layoutable_setUniqueId(Ark_NativePointer thisPtr, KInteropNumber uniqueId) { + Ark_Layoutable self = reinterpret_cast(thisPtr); + GetAccessors()->getLayoutableAccessor()->setUniqueId(self, (const Ark_Number*) (&uniqueId)); +} +KOALA_INTEROP_DIRECT_V2(Layoutable_setUniqueId, Ark_NativePointer, KInteropNumber) Ark_NativePointer impl_Measurable_ctor() { return GetAccessors()->getMeasurableAccessor()->ctor(); } diff --git a/arkoala-arkts/framework/native/src/generated/callback_deserialize_call.cc b/arkoala-arkts/framework/native/src/generated/callback_deserialize_call.cc index 51f008ff1..ddee7de8b 100644 --- a/arkoala-arkts/framework/native/src/generated/callback_deserialize_call.cc +++ b/arkoala-arkts/framework/native/src/generated/callback_deserialize_call.cc @@ -2218,6 +2218,44 @@ void deserializeAndCallSyncCallback_OnLoadInterceptEvent_Boolean(Ark_VMContext v Callback_Boolean_Void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_Boolean_Void)))), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCallerSync(Kind_Callback_Boolean_Void))))}; _callSync(vmContext, _resourceId, parameter, _continuation); } +void deserializeAndCallCallback_onMeasureSize_SizeResult(KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + const auto _call = reinterpret_cast(thisDeserializer.readPointer()); + thisDeserializer.readPointer(); + Ark_GeometryInfo selfLayoutInfo = thisDeserializer.readGeometryInfo(); + const Ark_Int32 children_buf_length = thisDeserializer.readInt32(); + Array_Measurable children_buf = {}; + thisDeserializer.resizeArray::type, + std::decay::type>(&children_buf, children_buf_length); + for (int children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf.array[children_buf_i] = static_cast(thisDeserializer.readMeasurable()); + } + Array_Measurable children = children_buf; + Ark_ConstraintSizeOptions constraint = thisDeserializer.readConstraintSizeOptions(); + Callback_SizeResult_Void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_SizeResult_Void)))), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCallerSync(Kind_Callback_SizeResult_Void))))}; + _call(_resourceId, selfLayoutInfo, children, constraint, _continuation); +} +void deserializeAndCallSyncCallback_onMeasureSize_SizeResult(Ark_VMContext vmContext, KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + thisDeserializer.readPointer(); + const auto _callSync = reinterpret_cast(thisDeserializer.readPointer()); + Ark_GeometryInfo selfLayoutInfo = thisDeserializer.readGeometryInfo(); + const Ark_Int32 children_buf_length = thisDeserializer.readInt32(); + Array_Measurable children_buf = {}; + thisDeserializer.resizeArray::type, + std::decay::type>(&children_buf, children_buf_length); + for (int children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf.array[children_buf_i] = static_cast(thisDeserializer.readMeasurable()); + } + Array_Measurable children = children_buf; + Ark_ConstraintSizeOptions constraint = thisDeserializer.readConstraintSizeOptions(); + Callback_SizeResult_Void _continuation = {thisDeserializer.readCallbackResource(), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCaller(Kind_Callback_SizeResult_Void)))), reinterpret_cast(thisDeserializer.readPointerOrDefault(reinterpret_cast(getManagedCallbackCallerSync(Kind_Callback_SizeResult_Void))))}; + _callSync(vmContext, _resourceId, selfLayoutInfo, children, constraint, _continuation); +} void deserializeAndCallCallback_OnOverScrollEvent_Void(KSerializerBuffer thisArray, Ark_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); @@ -2308,6 +2346,42 @@ void deserializeAndCallSyncCallback_OnPermissionRequestEvent_Void(Ark_VMContext Ark_OnPermissionRequestEvent parameter = thisDeserializer.readOnPermissionRequestEvent(); _callSync(vmContext, _resourceId, parameter); } +void deserializeAndCallCallback_onPlaceChildren_Void(KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + const auto _call = reinterpret_cast(thisDeserializer.readPointer()); + thisDeserializer.readPointer(); + Ark_GeometryInfo selfLayoutInfo = thisDeserializer.readGeometryInfo(); + const Ark_Int32 children_buf_length = thisDeserializer.readInt32(); + Array_Layoutable children_buf = {}; + thisDeserializer.resizeArray::type, + std::decay::type>(&children_buf, children_buf_length); + for (int children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf.array[children_buf_i] = static_cast(thisDeserializer.readLayoutable()); + } + Array_Layoutable children = children_buf; + Ark_ConstraintSizeOptions constraint = thisDeserializer.readConstraintSizeOptions(); + _call(_resourceId, selfLayoutInfo, children, constraint); +} +void deserializeAndCallSyncCallback_onPlaceChildren_Void(Ark_VMContext vmContext, KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + thisDeserializer.readPointer(); + const auto _callSync = reinterpret_cast(thisDeserializer.readPointer()); + Ark_GeometryInfo selfLayoutInfo = thisDeserializer.readGeometryInfo(); + const Ark_Int32 children_buf_length = thisDeserializer.readInt32(); + Array_Layoutable children_buf = {}; + thisDeserializer.resizeArray::type, + std::decay::type>(&children_buf, children_buf_length); + for (int children_buf_i = 0; children_buf_i < children_buf_length; children_buf_i++) { + children_buf.array[children_buf_i] = static_cast(thisDeserializer.readLayoutable()); + } + Array_Layoutable children = children_buf; + Ark_ConstraintSizeOptions constraint = thisDeserializer.readConstraintSizeOptions(); + _callSync(vmContext, _resourceId, selfLayoutInfo, children, constraint); +} void deserializeAndCallCallback_OnProgressChangeEvent_Void(KSerializerBuffer thisArray, Ark_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); @@ -3342,6 +3416,24 @@ void deserializeAndCallSyncCallback_SheetType_Void(Ark_VMContext vmContext, KSer Ark_SheetType parameter = static_cast(thisDeserializer.readInt32()); _callSync(vmContext, _resourceId, parameter); } +void deserializeAndCallCallback_SizeResult_Void(KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + const auto _call = reinterpret_cast(thisDeserializer.readPointer()); + thisDeserializer.readPointer(); + Ark_SizeResult value = thisDeserializer.readSizeResult(); + _call(_resourceId, value); +} +void deserializeAndCallSyncCallback_SizeResult_Void(Ark_VMContext vmContext, KSerializerBuffer thisArray, Ark_Int32 thisLength) +{ + Deserializer thisDeserializer = Deserializer(thisArray, thisLength); + const Ark_Int32 _resourceId = thisDeserializer.readInt32(); + thisDeserializer.readPointer(); + const auto _callSync = reinterpret_cast(thisDeserializer.readPointer()); + Ark_SizeResult value = thisDeserializer.readSizeResult(); + _callSync(vmContext, _resourceId, value); +} void deserializeAndCallCallback_SpringBackAction_Void(KSerializerBuffer thisArray, Ark_Int32 thisLength) { Deserializer thisDeserializer = Deserializer(thisArray, thisLength); @@ -6813,11 +6905,13 @@ void deserializeAndCallCallback(Ark_Int32 kind, KSerializerBuffer thisArray, Ark case -2066745559/*Kind_Callback_OnHttpErrorReceiveEvent_Void*/: return deserializeAndCallCallback_OnHttpErrorReceiveEvent_Void(thisArray, thisLength); case 1442698200/*Kind_Callback_OnInterceptRequestEvent_WebResourceResponse*/: return deserializeAndCallCallback_OnInterceptRequestEvent_WebResourceResponse(thisArray, thisLength); case 1231444306/*Kind_Callback_OnLoadInterceptEvent_Boolean*/: return deserializeAndCallCallback_OnLoadInterceptEvent_Boolean(thisArray, thisLength); + case -1356285653/*Kind_Callback_onMeasureSize_SizeResult*/: return deserializeAndCallCallback_onMeasureSize_SizeResult(thisArray, thisLength); case -860386431/*Kind_Callback_OnOverScrollEvent_Void*/: return deserializeAndCallCallback_OnOverScrollEvent_Void(thisArray, thisLength); case -2040193994/*Kind_Callback_OnPageBeginEvent_Void*/: return deserializeAndCallCallback_OnPageBeginEvent_Void(thisArray, thisLength); case -130135362/*Kind_Callback_OnPageEndEvent_Void*/: return deserializeAndCallCallback_OnPageEndEvent_Void(thisArray, thisLength); case 1805946367/*Kind_Callback_OnPageVisibleEvent_Void*/: return deserializeAndCallCallback_OnPageVisibleEvent_Void(thisArray, thisLength); case 529980696/*Kind_Callback_OnPermissionRequestEvent_Void*/: return deserializeAndCallCallback_OnPermissionRequestEvent_Void(thisArray, thisLength); + case -738620506/*Kind_Callback_onPlaceChildren_Void*/: return deserializeAndCallCallback_onPlaceChildren_Void(thisArray, thisLength); case 1018740377/*Kind_Callback_OnProgressChangeEvent_Void*/: return deserializeAndCallCallback_OnProgressChangeEvent_Void(thisArray, thisLength); case -1826742986/*Kind_Callback_OnPromptEvent_Boolean*/: return deserializeAndCallCallback_OnPromptEvent_Boolean(thisArray, thisLength); case 1978364344/*Kind_Callback_OnRefreshAccessedHistoryEvent_Void*/: return deserializeAndCallCallback_OnRefreshAccessedHistoryEvent_Void(thisArray, thisLength); @@ -6859,6 +6953,7 @@ void deserializeAndCallCallback(Ark_Int32 kind, KSerializerBuffer thisArray, Ark case 1980824326/*Kind_Callback_RichEditorTextSpanResult_Void*/: return deserializeAndCallCallback_RichEditorTextSpanResult_Void(thisArray, thisLength); case 22609082/*Kind_Callback_SheetDismiss_Void*/: return deserializeAndCallCallback_SheetDismiss_Void(thisArray, thisLength); case -224451112/*Kind_Callback_SheetType_Void*/: return deserializeAndCallCallback_SheetType_Void(thisArray, thisLength); + case 1318865891/*Kind_Callback_SizeResult_Void*/: return deserializeAndCallCallback_SizeResult_Void(thisArray, thisLength); case 1536231691/*Kind_Callback_SpringBackAction_Void*/: return deserializeAndCallCallback_SpringBackAction_Void(thisArray, thisLength); case -879490874/*Kind_Callback_String_Number_Void*/: return deserializeAndCallCallback_String_Number_Void(thisArray, thisLength); case -716524508/*Kind_Callback_String_Opt_Object_Void*/: return deserializeAndCallCallback_String_Opt_Object_Void(thisArray, thisLength); @@ -7104,11 +7199,13 @@ void deserializeAndCallCallbackSync(Ark_VMContext vmContext, Ark_Int32 kind, KSe case -2066745559/*Kind_Callback_OnHttpErrorReceiveEvent_Void*/: return deserializeAndCallSyncCallback_OnHttpErrorReceiveEvent_Void(vmContext, thisArray, thisLength); case 1442698200/*Kind_Callback_OnInterceptRequestEvent_WebResourceResponse*/: return deserializeAndCallSyncCallback_OnInterceptRequestEvent_WebResourceResponse(vmContext, thisArray, thisLength); case 1231444306/*Kind_Callback_OnLoadInterceptEvent_Boolean*/: return deserializeAndCallSyncCallback_OnLoadInterceptEvent_Boolean(vmContext, thisArray, thisLength); + case -1356285653/*Kind_Callback_onMeasureSize_SizeResult*/: return deserializeAndCallSyncCallback_onMeasureSize_SizeResult(vmContext, thisArray, thisLength); case -860386431/*Kind_Callback_OnOverScrollEvent_Void*/: return deserializeAndCallSyncCallback_OnOverScrollEvent_Void(vmContext, thisArray, thisLength); case -2040193994/*Kind_Callback_OnPageBeginEvent_Void*/: return deserializeAndCallSyncCallback_OnPageBeginEvent_Void(vmContext, thisArray, thisLength); case -130135362/*Kind_Callback_OnPageEndEvent_Void*/: return deserializeAndCallSyncCallback_OnPageEndEvent_Void(vmContext, thisArray, thisLength); case 1805946367/*Kind_Callback_OnPageVisibleEvent_Void*/: return deserializeAndCallSyncCallback_OnPageVisibleEvent_Void(vmContext, thisArray, thisLength); case 529980696/*Kind_Callback_OnPermissionRequestEvent_Void*/: return deserializeAndCallSyncCallback_OnPermissionRequestEvent_Void(vmContext, thisArray, thisLength); + case -738620506/*Kind_Callback_onPlaceChildren_Void*/: return deserializeAndCallSyncCallback_onPlaceChildren_Void(vmContext, thisArray, thisLength); case 1018740377/*Kind_Callback_OnProgressChangeEvent_Void*/: return deserializeAndCallSyncCallback_OnProgressChangeEvent_Void(vmContext, thisArray, thisLength); case -1826742986/*Kind_Callback_OnPromptEvent_Boolean*/: return deserializeAndCallSyncCallback_OnPromptEvent_Boolean(vmContext, thisArray, thisLength); case 1978364344/*Kind_Callback_OnRefreshAccessedHistoryEvent_Void*/: return deserializeAndCallSyncCallback_OnRefreshAccessedHistoryEvent_Void(vmContext, thisArray, thisLength); @@ -7150,6 +7247,7 @@ void deserializeAndCallCallbackSync(Ark_VMContext vmContext, Ark_Int32 kind, KSe case 1980824326/*Kind_Callback_RichEditorTextSpanResult_Void*/: return deserializeAndCallSyncCallback_RichEditorTextSpanResult_Void(vmContext, thisArray, thisLength); case 22609082/*Kind_Callback_SheetDismiss_Void*/: return deserializeAndCallSyncCallback_SheetDismiss_Void(vmContext, thisArray, thisLength); case -224451112/*Kind_Callback_SheetType_Void*/: return deserializeAndCallSyncCallback_SheetType_Void(vmContext, thisArray, thisLength); + case 1318865891/*Kind_Callback_SizeResult_Void*/: return deserializeAndCallSyncCallback_SizeResult_Void(vmContext, thisArray, thisLength); case 1536231691/*Kind_Callback_SpringBackAction_Void*/: return deserializeAndCallSyncCallback_SpringBackAction_Void(vmContext, thisArray, thisLength); case -879490874/*Kind_Callback_String_Number_Void*/: return deserializeAndCallSyncCallback_String_Number_Void(vmContext, thisArray, thisLength); case -716524508/*Kind_Callback_String_Opt_Object_Void*/: return deserializeAndCallSyncCallback_String_Opt_Object_Void(vmContext, thisArray, thisLength); diff --git a/arkoala-arkts/framework/native/src/generated/callback_kind.h b/arkoala-arkts/framework/native/src/generated/callback_kind.h index 940b3ed06..3743b57a6 100644 --- a/arkoala-arkts/framework/native/src/generated/callback_kind.h +++ b/arkoala-arkts/framework/native/src/generated/callback_kind.h @@ -109,11 +109,13 @@ typedef enum CallbackKind { Kind_Callback_OnHttpErrorReceiveEvent_Void = -2066745559, Kind_Callback_OnInterceptRequestEvent_WebResourceResponse = 1442698200, Kind_Callback_OnLoadInterceptEvent_Boolean = 1231444306, + Kind_Callback_onMeasureSize_SizeResult = -1356285653, Kind_Callback_OnOverScrollEvent_Void = -860386431, Kind_Callback_OnPageBeginEvent_Void = -2040193994, Kind_Callback_OnPageEndEvent_Void = -130135362, Kind_Callback_OnPageVisibleEvent_Void = 1805946367, Kind_Callback_OnPermissionRequestEvent_Void = 529980696, + Kind_Callback_onPlaceChildren_Void = -738620506, Kind_Callback_OnProgressChangeEvent_Void = 1018740377, Kind_Callback_OnPromptEvent_Boolean = -1826742986, Kind_Callback_OnRefreshAccessedHistoryEvent_Void = 1978364344, @@ -155,6 +157,7 @@ typedef enum CallbackKind { Kind_Callback_RichEditorTextSpanResult_Void = 1980824326, Kind_Callback_SheetDismiss_Void = 22609082, Kind_Callback_SheetType_Void = -224451112, + Kind_Callback_SizeResult_Void = 1318865891, Kind_Callback_SpringBackAction_Void = 1536231691, Kind_Callback_String_Number_Void = -879490874, Kind_Callback_String_Opt_Object_Void = -716524508, diff --git a/arkoala-arkts/framework/native/src/generated/callback_managed_caller.cc b/arkoala-arkts/framework/native/src/generated/callback_managed_caller.cc index b8a7d61c7..b6254520c 100644 --- a/arkoala-arkts/framework/native/src/generated/callback_managed_caller.cc +++ b/arkoala-arkts/framework/native/src/generated/callback_managed_caller.cc @@ -2487,6 +2487,44 @@ void callManagedCallback_OnLoadInterceptEvent_BooleanSync(Ark_VMContext vmContex argsSerializer.writePointer(reinterpret_cast(continuation.callSync)); KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); } +void callManagedCallback_onMeasureSize_SizeResult(Ark_Int32 resourceId, Ark_GeometryInfo selfLayoutInfo, Array_Measurable children, Ark_ConstraintSizeOptions constraint, Callback_SizeResult_Void continuation) +{ + CallbackBuffer _buffer = {{}, {}}; + const Ark_CallbackResource _callbackResourceSelf = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; + _buffer.resourceHolder.holdCallbackResource(&_callbackResourceSelf); + Serializer argsSerializer = Serializer((KSerializerBuffer)&(_buffer.buffer), sizeof(_buffer.buffer), &(_buffer.resourceHolder)); + argsSerializer.writeInt32(Kind_Callback_onMeasureSize_SizeResult); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeGeometryInfo(selfLayoutInfo); + argsSerializer.writeInt32(children.length); + for (int i = 0; i < children.length; i++) { + const Ark_Measurable children_element = children.array[i]; + argsSerializer.writeMeasurable(children_element); + } + argsSerializer.writeConstraintSizeOptions(constraint); + argsSerializer.writeCallbackResource(continuation.resource); + argsSerializer.writePointer(reinterpret_cast(continuation.call)); + argsSerializer.writePointer(reinterpret_cast(continuation.callSync)); + enqueueCallback(&_buffer); +} +void callManagedCallback_onMeasureSize_SizeResultSync(Ark_VMContext vmContext, Ark_Int32 resourceId, Ark_GeometryInfo selfLayoutInfo, Array_Measurable children, Ark_ConstraintSizeOptions constraint, Callback_SizeResult_Void continuation) +{ + uint8_t _buffer[4096]; + Serializer argsSerializer = Serializer((KSerializerBuffer)&_buffer, sizeof(_buffer), nullptr); + argsSerializer.writeInt32(Kind_Callback_onMeasureSize_SizeResult); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeGeometryInfo(selfLayoutInfo); + argsSerializer.writeInt32(children.length); + for (int i = 0; i < children.length; i++) { + const Ark_Measurable children_element = children.array[i]; + argsSerializer.writeMeasurable(children_element); + } + argsSerializer.writeConstraintSizeOptions(constraint); + argsSerializer.writeCallbackResource(continuation.resource); + argsSerializer.writePointer(reinterpret_cast(continuation.call)); + argsSerializer.writePointer(reinterpret_cast(continuation.callSync)); + KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); +} void callManagedCallback_OnOverScrollEvent_Void(Ark_Int32 resourceId, Ark_OnOverScrollEvent parameter) { CallbackBuffer _buffer = {{}, {}}; @@ -2587,6 +2625,38 @@ void callManagedCallback_OnPermissionRequestEvent_VoidSync(Ark_VMContext vmConte argsSerializer.writeOnPermissionRequestEvent(parameter); KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); } +void callManagedCallback_onPlaceChildren_Void(Ark_Int32 resourceId, Ark_GeometryInfo selfLayoutInfo, Array_Layoutable children, Ark_ConstraintSizeOptions constraint) +{ + CallbackBuffer _buffer = {{}, {}}; + const Ark_CallbackResource _callbackResourceSelf = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; + _buffer.resourceHolder.holdCallbackResource(&_callbackResourceSelf); + Serializer argsSerializer = Serializer((KSerializerBuffer)&(_buffer.buffer), sizeof(_buffer.buffer), &(_buffer.resourceHolder)); + argsSerializer.writeInt32(Kind_Callback_onPlaceChildren_Void); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeGeometryInfo(selfLayoutInfo); + argsSerializer.writeInt32(children.length); + for (int i = 0; i < children.length; i++) { + const Ark_Layoutable children_element = children.array[i]; + argsSerializer.writeLayoutable(children_element); + } + argsSerializer.writeConstraintSizeOptions(constraint); + enqueueCallback(&_buffer); +} +void callManagedCallback_onPlaceChildren_VoidSync(Ark_VMContext vmContext, Ark_Int32 resourceId, Ark_GeometryInfo selfLayoutInfo, Array_Layoutable children, Ark_ConstraintSizeOptions constraint) +{ + uint8_t _buffer[4096]; + Serializer argsSerializer = Serializer((KSerializerBuffer)&_buffer, sizeof(_buffer), nullptr); + argsSerializer.writeInt32(Kind_Callback_onPlaceChildren_Void); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeGeometryInfo(selfLayoutInfo); + argsSerializer.writeInt32(children.length); + for (int i = 0; i < children.length; i++) { + const Ark_Layoutable children_element = children.array[i]; + argsSerializer.writeLayoutable(children_element); + } + argsSerializer.writeConstraintSizeOptions(constraint); + KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); +} void callManagedCallback_OnProgressChangeEvent_Void(Ark_Int32 resourceId, Ark_OnProgressChangeEvent parameter) { CallbackBuffer _buffer = {{}, {}}; @@ -3665,6 +3735,26 @@ void callManagedCallback_SheetType_VoidSync(Ark_VMContext vmContext, Ark_Int32 r argsSerializer.writeInt32(static_cast(parameter)); KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); } +void callManagedCallback_SizeResult_Void(Ark_Int32 resourceId, Ark_SizeResult value) +{ + CallbackBuffer _buffer = {{}, {}}; + const Ark_CallbackResource _callbackResourceSelf = {resourceId, holdManagedCallbackResource, releaseManagedCallbackResource}; + _buffer.resourceHolder.holdCallbackResource(&_callbackResourceSelf); + Serializer argsSerializer = Serializer((KSerializerBuffer)&(_buffer.buffer), sizeof(_buffer.buffer), &(_buffer.resourceHolder)); + argsSerializer.writeInt32(Kind_Callback_SizeResult_Void); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeSizeResult(value); + enqueueCallback(&_buffer); +} +void callManagedCallback_SizeResult_VoidSync(Ark_VMContext vmContext, Ark_Int32 resourceId, Ark_SizeResult value) +{ + uint8_t _buffer[4096]; + Serializer argsSerializer = Serializer((KSerializerBuffer)&_buffer, sizeof(_buffer), nullptr); + argsSerializer.writeInt32(Kind_Callback_SizeResult_Void); + argsSerializer.writeInt32(resourceId); + argsSerializer.writeSizeResult(value); + KOALA_INTEROP_CALL_VOID(vmContext, 1, sizeof(_buffer), _buffer); +} void callManagedCallback_SpringBackAction_Void(Ark_Int32 resourceId, Ark_SpringBackAction parameter) { CallbackBuffer _buffer = {{}, {}}; @@ -7322,11 +7412,13 @@ Ark_NativePointer getManagedCallbackCaller(CallbackKind kind) case Kind_Callback_OnHttpErrorReceiveEvent_Void: return reinterpret_cast(callManagedCallback_OnHttpErrorReceiveEvent_Void); case Kind_Callback_OnInterceptRequestEvent_WebResourceResponse: return reinterpret_cast(callManagedCallback_OnInterceptRequestEvent_WebResourceResponse); case Kind_Callback_OnLoadInterceptEvent_Boolean: return reinterpret_cast(callManagedCallback_OnLoadInterceptEvent_Boolean); + case Kind_Callback_onMeasureSize_SizeResult: return reinterpret_cast(callManagedCallback_onMeasureSize_SizeResult); case Kind_Callback_OnOverScrollEvent_Void: return reinterpret_cast(callManagedCallback_OnOverScrollEvent_Void); case Kind_Callback_OnPageBeginEvent_Void: return reinterpret_cast(callManagedCallback_OnPageBeginEvent_Void); case Kind_Callback_OnPageEndEvent_Void: return reinterpret_cast(callManagedCallback_OnPageEndEvent_Void); case Kind_Callback_OnPageVisibleEvent_Void: return reinterpret_cast(callManagedCallback_OnPageVisibleEvent_Void); case Kind_Callback_OnPermissionRequestEvent_Void: return reinterpret_cast(callManagedCallback_OnPermissionRequestEvent_Void); + case Kind_Callback_onPlaceChildren_Void: return reinterpret_cast(callManagedCallback_onPlaceChildren_Void); case Kind_Callback_OnProgressChangeEvent_Void: return reinterpret_cast(callManagedCallback_OnProgressChangeEvent_Void); case Kind_Callback_OnPromptEvent_Boolean: return reinterpret_cast(callManagedCallback_OnPromptEvent_Boolean); case Kind_Callback_OnRefreshAccessedHistoryEvent_Void: return reinterpret_cast(callManagedCallback_OnRefreshAccessedHistoryEvent_Void); @@ -7368,6 +7460,7 @@ Ark_NativePointer getManagedCallbackCaller(CallbackKind kind) case Kind_Callback_RichEditorTextSpanResult_Void: return reinterpret_cast(callManagedCallback_RichEditorTextSpanResult_Void); case Kind_Callback_SheetDismiss_Void: return reinterpret_cast(callManagedCallback_SheetDismiss_Void); case Kind_Callback_SheetType_Void: return reinterpret_cast(callManagedCallback_SheetType_Void); + case Kind_Callback_SizeResult_Void: return reinterpret_cast(callManagedCallback_SizeResult_Void); case Kind_Callback_SpringBackAction_Void: return reinterpret_cast(callManagedCallback_SpringBackAction_Void); case Kind_Callback_String_Number_Void: return reinterpret_cast(callManagedCallback_String_Number_Void); case Kind_Callback_String_Opt_Object_Void: return reinterpret_cast(callManagedCallback_String_Opt_Object_Void); @@ -7612,11 +7705,13 @@ Ark_NativePointer getManagedCallbackCallerSync(CallbackKind kind) case Kind_Callback_OnHttpErrorReceiveEvent_Void: return reinterpret_cast(callManagedCallback_OnHttpErrorReceiveEvent_VoidSync); case Kind_Callback_OnInterceptRequestEvent_WebResourceResponse: return reinterpret_cast(callManagedCallback_OnInterceptRequestEvent_WebResourceResponseSync); case Kind_Callback_OnLoadInterceptEvent_Boolean: return reinterpret_cast(callManagedCallback_OnLoadInterceptEvent_BooleanSync); + case Kind_Callback_onMeasureSize_SizeResult: return reinterpret_cast(callManagedCallback_onMeasureSize_SizeResultSync); case Kind_Callback_OnOverScrollEvent_Void: return reinterpret_cast(callManagedCallback_OnOverScrollEvent_VoidSync); case Kind_Callback_OnPageBeginEvent_Void: return reinterpret_cast(callManagedCallback_OnPageBeginEvent_VoidSync); case Kind_Callback_OnPageEndEvent_Void: return reinterpret_cast(callManagedCallback_OnPageEndEvent_VoidSync); case Kind_Callback_OnPageVisibleEvent_Void: return reinterpret_cast(callManagedCallback_OnPageVisibleEvent_VoidSync); case Kind_Callback_OnPermissionRequestEvent_Void: return reinterpret_cast(callManagedCallback_OnPermissionRequestEvent_VoidSync); + case Kind_Callback_onPlaceChildren_Void: return reinterpret_cast(callManagedCallback_onPlaceChildren_VoidSync); case Kind_Callback_OnProgressChangeEvent_Void: return reinterpret_cast(callManagedCallback_OnProgressChangeEvent_VoidSync); case Kind_Callback_OnPromptEvent_Boolean: return reinterpret_cast(callManagedCallback_OnPromptEvent_BooleanSync); case Kind_Callback_OnRefreshAccessedHistoryEvent_Void: return reinterpret_cast(callManagedCallback_OnRefreshAccessedHistoryEvent_VoidSync); @@ -7658,6 +7753,7 @@ Ark_NativePointer getManagedCallbackCallerSync(CallbackKind kind) case Kind_Callback_RichEditorTextSpanResult_Void: return reinterpret_cast(callManagedCallback_RichEditorTextSpanResult_VoidSync); case Kind_Callback_SheetDismiss_Void: return reinterpret_cast(callManagedCallback_SheetDismiss_VoidSync); case Kind_Callback_SheetType_Void: return reinterpret_cast(callManagedCallback_SheetType_VoidSync); + case Kind_Callback_SizeResult_Void: return reinterpret_cast(callManagedCallback_SizeResult_VoidSync); case Kind_Callback_SpringBackAction_Void: return reinterpret_cast(callManagedCallback_SpringBackAction_VoidSync); case Kind_Callback_String_Number_Void: return reinterpret_cast(callManagedCallback_String_Number_VoidSync); case Kind_Callback_String_Opt_Object_Void: return reinterpret_cast(callManagedCallback_String_Opt_Object_VoidSync); diff --git a/arkoala-arkts/framework/native/src/generated/dummy_impl.cc b/arkoala-arkts/framework/native/src/generated/dummy_impl.cc index be09b6d58..548259d1e 100644 --- a/arkoala-arkts/framework/native/src/generated/dummy_impl.cc +++ b/arkoala-arkts/framework/native/src/generated/dummy_impl.cc @@ -974,6 +974,42 @@ namespace OHOS::Ace::NG::GeneratedModifier { return new TreeNode("ComponentRoot", id, flags);; } } // ComponentRootModifier + namespace CustomLayoutRootModifier { + Ark_NativePointer ConstructImpl(Ark_Int32 id, + Ark_Int32 flags) + { + if (!needGroupedLog(1)) + return new TreeNode("CustomLayoutRoot", id, flags);; + string out("construct("); + WriteToString(&out, id); + out.append(", "); + WriteToString(&out, flags); + out.append(") \n"); + out.append("[return nullptr] \n"); + appendGroupedLog(1, out); + return new TreeNode("CustomLayoutRoot", id, flags);; + } + void SubscribeOnMeasureSizeImpl(Ark_NativePointer node, + const Callback_onMeasureSize_SizeResult* value) + { + if (!needGroupedLog(1)) + return; + string out("subscribeOnMeasureSize("); + WriteToString(&out, value); + out.append(") \n"); + appendGroupedLog(1, out); + } + void SubscribeOnPlaceChildrenImpl(Ark_NativePointer node, + const Callback_onPlaceChildren_Void* value) + { + if (!needGroupedLog(1)) + return; + string out("subscribeOnPlaceChildren("); + WriteToString(&out, value); + out.append(") \n"); + appendGroupedLog(1, out); + } + } // CustomLayoutRootModifier namespace AbilityComponentModifier { Ark_NativePointer ConstructImpl(Ark_Int32 id, Ark_Int32 flags) @@ -20700,6 +20736,16 @@ namespace OHOS::Ace::NG::GeneratedModifier { return &ArkUIComponentRootModifierImpl; } + const GENERATED_ArkUICustomLayoutRootModifier* GetCustomLayoutRootModifier() + { + static const GENERATED_ArkUICustomLayoutRootModifier ArkUICustomLayoutRootModifierImpl { + CustomLayoutRootModifier::ConstructImpl, + CustomLayoutRootModifier::SubscribeOnMeasureSizeImpl, + CustomLayoutRootModifier::SubscribeOnPlaceChildrenImpl, + }; + return &ArkUICustomLayoutRootModifierImpl; + } + const GENERATED_ArkUIAbilityComponentModifier* GetAbilityComponentModifier() { static const GENERATED_ArkUIAbilityComponentModifier ArkUIAbilityComponentModifierImpl { @@ -23342,6 +23388,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { static const GENERATED_ArkUINodeModifiers modifiersImpl = { GetRootModifier, GetComponentRootModifier, + GetCustomLayoutRootModifier, GetAbilityComponentModifier, GetAlphabetIndexerModifier, GetAnimatorModifier, @@ -30653,6 +30700,116 @@ namespace OHOS::Ace::NG::GeneratedModifier { appendGroupedLog(1, out); } } // ProgressMaskAccessor + namespace LayoutableAccessor { + void DestroyPeerImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return; + string out("destroyPeer("); + out.append(") \n"); + appendGroupedLog(1, out); + } + Ark_Layoutable CtorImpl() + { + if (!needGroupedLog(1)) + return (Ark_Layoutable) 100; + string out("new Layoutable("); + out.append(") \n"); + out.append("[return (Ark_Layoutable) 100] \n"); + appendGroupedLog(1, out); + return (Ark_Layoutable) 100; + } + Ark_NativePointer GetFinalizerImpl() + { + if (!needGroupedLog(1)) + return fnPtr(dummyClassFinalizer); + string out("getFinalizer("); + out.append(") \n"); + out.append("[return fnPtr(dummyClassFinalizer)] \n"); + appendGroupedLog(1, out); + return fnPtr(dummyClassFinalizer); + } + void LayoutImpl(Ark_Layoutable peer, + const Ark_Position* position) + { + if (!needGroupedLog(1)) + return; + string out("layout("); + WriteToString(&out, position); + out.append(") \n"); + appendGroupedLog(1, out); + } + Ark_DirectionalEdgesT GetMarginImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return {}; + string out("getMargin("); + out.append(") \n"); + out.append("[return {}] \n"); + appendGroupedLog(1, out); + return {}; + } + Ark_DirectionalEdgesT GetPaddingImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return {}; + string out("getPadding("); + out.append(") \n"); + out.append("[return {}] \n"); + appendGroupedLog(1, out); + return {}; + } + Ark_DirectionalEdgesT GetBorderWidthImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return {}; + string out("getBorderWidth("); + out.append(") \n"); + out.append("[return {}] \n"); + appendGroupedLog(1, out); + return {}; + } + Ark_MeasureResult GetMeasureResultImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return {}; + string out("getMeasureResult("); + out.append(") \n"); + out.append("[return {}] \n"); + appendGroupedLog(1, out); + return {}; + } + void SetMeasureResultImpl(Ark_Layoutable peer, + const Ark_MeasureResult* measureResult) + { + if (!needGroupedLog(1)) + return; + string out("setMeasureResult("); + WriteToString(&out, measureResult); + out.append(") \n"); + appendGroupedLog(1, out); + } + Opt_Number GetUniqueIdImpl(Ark_Layoutable peer) + { + if (!needGroupedLog(1)) + return {}; + string out("getUniqueId("); + out.append(") \n"); + out.append("[return {}] \n"); + appendGroupedLog(1, out); + return {}; + } + void SetUniqueIdImpl(Ark_Layoutable peer, + const Ark_Number* uniqueId) + { + if (!needGroupedLog(1)) + return; + string out("setUniqueId("); + WriteToString(&out, uniqueId); + out.append(") \n"); + appendGroupedLog(1, out); + } + } // LayoutableAccessor namespace MeasurableAccessor { void DestroyPeerImpl(Ark_Measurable peer) { @@ -43565,6 +43722,27 @@ namespace OHOS::Ace::NG::GeneratedModifier { struct ProgressMaskPeer { virtual ~ProgressMaskPeer() = default; }; + const GENERATED_ArkUILayoutableAccessor* GetLayoutableAccessor() + { + static const GENERATED_ArkUILayoutableAccessor LayoutableAccessorImpl { + LayoutableAccessor::DestroyPeerImpl, + LayoutableAccessor::CtorImpl, + LayoutableAccessor::GetFinalizerImpl, + LayoutableAccessor::LayoutImpl, + LayoutableAccessor::GetMarginImpl, + LayoutableAccessor::GetPaddingImpl, + LayoutableAccessor::GetBorderWidthImpl, + LayoutableAccessor::GetMeasureResultImpl, + LayoutableAccessor::SetMeasureResultImpl, + LayoutableAccessor::GetUniqueIdImpl, + LayoutableAccessor::SetUniqueIdImpl, + }; + return &LayoutableAccessorImpl; + } + + struct LayoutablePeer { + virtual ~LayoutablePeer() = default; + }; const GENERATED_ArkUIMeasurableAccessor* GetMeasurableAccessor() { static const GENERATED_ArkUIMeasurableAccessor MeasurableAccessorImpl { @@ -45984,6 +46162,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { GetKeyEventAccessor, GetFocusAxisEventAccessor, GetProgressMaskAccessor, + GetLayoutableAccessor, GetMeasurableAccessor, GetViewAccessor, GetTextContentControllerBaseAccessor, diff --git a/arkoala-arkts/framework/native/src/generated/real_impl.cc b/arkoala-arkts/framework/native/src/generated/real_impl.cc index 6b06d6e42..22014f7a6 100644 --- a/arkoala-arkts/framework/native/src/generated/real_impl.cc +++ b/arkoala-arkts/framework/native/src/generated/real_impl.cc @@ -954,6 +954,21 @@ namespace OHOS::Ace::NG::GeneratedModifier { return {}; } } // ComponentRootModifier + namespace CustomLayoutRootModifier { + Ark_NativePointer ConstructImpl(Ark_Int32 id, + Ark_Int32 flags) + { + return {}; + } + void SubscribeOnMeasureSizeImpl(Ark_NativePointer node, + const Callback_onMeasureSize_SizeResult* value) + { + } + void SubscribeOnPlaceChildrenImpl(Ark_NativePointer node, + const Callback_onPlaceChildren_Void* value) + { + } + } // CustomLayoutRootModifier namespace AbilityComponentModifier { Ark_NativePointer ConstructImpl(Ark_Int32 id, Ark_Int32 flags) @@ -9139,6 +9154,16 @@ namespace OHOS::Ace::NG::GeneratedModifier { return &ArkUIComponentRootModifierImpl; } + const GENERATED_ArkUICustomLayoutRootModifier* GetCustomLayoutRootModifier() + { + static const GENERATED_ArkUICustomLayoutRootModifier ArkUICustomLayoutRootModifierImpl { + CustomLayoutRootModifier::ConstructImpl, + CustomLayoutRootModifier::SubscribeOnMeasureSizeImpl, + CustomLayoutRootModifier::SubscribeOnPlaceChildrenImpl, + }; + return &ArkUICustomLayoutRootModifierImpl; + } + const GENERATED_ArkUIAbilityComponentModifier* GetAbilityComponentModifier() { static const GENERATED_ArkUIAbilityComponentModifier ArkUIAbilityComponentModifierImpl { @@ -11781,6 +11806,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { static const GENERATED_ArkUINodeModifiers modifiersImpl = { GetRootModifier, GetComponentRootModifier, + GetCustomLayoutRootModifier, GetAbilityComponentModifier, GetAlphabetIndexerModifier, GetAnimatorModifier, @@ -15124,6 +15150,55 @@ namespace OHOS::Ace::NG::GeneratedModifier { { } } // ProgressMaskAccessor + namespace LayoutableAccessor { + void DestroyPeerImpl(Ark_Layoutable peer) + { + auto peerImpl = reinterpret_cast(peer); + if (peerImpl) { + delete peerImpl; + } + } + Ark_Layoutable CtorImpl() + { + return new LayoutablePeer(); + } + Ark_NativePointer GetFinalizerImpl() + { + return reinterpret_cast(&DestroyPeerImpl); + } + void LayoutImpl(Ark_Layoutable peer, + const Ark_Position* position) + { + } + Ark_DirectionalEdgesT GetMarginImpl(Ark_Layoutable peer) + { + return {}; + } + Ark_DirectionalEdgesT GetPaddingImpl(Ark_Layoutable peer) + { + return {}; + } + Ark_DirectionalEdgesT GetBorderWidthImpl(Ark_Layoutable peer) + { + return {}; + } + Ark_MeasureResult GetMeasureResultImpl(Ark_Layoutable peer) + { + return {}; + } + void SetMeasureResultImpl(Ark_Layoutable peer, + const Ark_MeasureResult* measureResult) + { + } + Opt_Number GetUniqueIdImpl(Ark_Layoutable peer) + { + return {}; + } + void SetUniqueIdImpl(Ark_Layoutable peer, + const Ark_Number* uniqueId) + { + } + } // LayoutableAccessor namespace MeasurableAccessor { void DestroyPeerImpl(Ark_Measurable peer) { @@ -21657,6 +21732,27 @@ namespace OHOS::Ace::NG::GeneratedModifier { struct ProgressMaskPeer { virtual ~ProgressMaskPeer() = default; }; + const GENERATED_ArkUILayoutableAccessor* GetLayoutableAccessor() + { + static const GENERATED_ArkUILayoutableAccessor LayoutableAccessorImpl { + LayoutableAccessor::DestroyPeerImpl, + LayoutableAccessor::CtorImpl, + LayoutableAccessor::GetFinalizerImpl, + LayoutableAccessor::LayoutImpl, + LayoutableAccessor::GetMarginImpl, + LayoutableAccessor::GetPaddingImpl, + LayoutableAccessor::GetBorderWidthImpl, + LayoutableAccessor::GetMeasureResultImpl, + LayoutableAccessor::SetMeasureResultImpl, + LayoutableAccessor::GetUniqueIdImpl, + LayoutableAccessor::SetUniqueIdImpl, + }; + return &LayoutableAccessorImpl; + } + + struct LayoutablePeer { + virtual ~LayoutablePeer() = default; + }; const GENERATED_ArkUIMeasurableAccessor* GetMeasurableAccessor() { static const GENERATED_ArkUIMeasurableAccessor MeasurableAccessorImpl { @@ -24076,6 +24172,7 @@ namespace OHOS::Ace::NG::GeneratedModifier { GetKeyEventAccessor, GetFocusAxisEventAccessor, GetProgressMaskAccessor, + GetLayoutableAccessor, GetMeasurableAccessor, GetViewAccessor, GetTextContentControllerBaseAccessor, -- Gitee From 31e68117e8be00cbb62f26508f031a9ba15601bb Mon Sep 17 00:00:00 2001 From: Ilya Erokhin Date: Mon, 26 May 2025 15:51:01 +0300 Subject: [PATCH 2/2] Custom Layout changes for Managed Part Signed-off-by: Ilya Erokhin --- arkoala-arkts/arkui/src/ArkComponentRoot.ts | 18 ++++++++++++++++-- arkoala-arkts/arkui/src/ArkCustomComponent.ts | 18 +++++++++++++++++- .../arkui/src/ets/ArkComponentRoot.ets | 18 ++++++++++++++++-- .../arkui/src/ets/ArkCustomComponent.ets | 18 +++++++++++++++++- 4 files changed, 66 insertions(+), 6 deletions(-) diff --git a/arkoala-arkts/arkui/src/ArkComponentRoot.ts b/arkoala-arkts/arkui/src/ArkComponentRoot.ts index 830864791..c4eea1719 100644 --- a/arkoala-arkts/arkui/src/ArkComponentRoot.ts +++ b/arkoala-arkts/arkui/src/ArkComponentRoot.ts @@ -15,7 +15,7 @@ import { mutableState, MutableState, NodeAttach, rememberDisposable, remember, RunEffect, scheduleCallback } from "@koalaui/runtime" import { PeerNode } from "./PeerNode"; -import { ArkComponentRootPeer } from "./generated"; +import { ArkComponentRootPeer, ArkCustomLayoutRootPeer, ConstraintSizeOptions, GeometryInfo, Layoutable, Measurable, SizeResult } from "./generated"; import { ArkCustomComponent } from "./ArkCustomComponent" import { int32 } from "@koalaui/common" import { CurrentRouterTransitionState, RouterTransitionVisibility } from "./handwritten/Router"; @@ -34,7 +34,21 @@ export function ArkComponentRoot( content: () => void ) { NodeAttach( - () => ArkComponentRootPeer.create(), + () => { + if (component.isLayoutComponent()) { + let peer = ArkCustomLayoutRootPeer.create(undefined) + peer.subscribeOnMeasureSizeAttribute((selfLayoutInfo: GeometryInfo, children: Array, + constraint: ConstraintSizeOptions): SizeResult => { + return component.onMeasureSize(selfLayoutInfo, children, constraint) + }) + peer.subscribeOnPlaceChildrenAttribute((selfLayoutInfo: GeometryInfo, children: Array, + constraint: ConstraintSizeOptions) => { + component.onPlaceChildren(selfLayoutInfo, children, constraint) + }) + return peer; + } + return ArkComponentRootPeer.create(undefined) + }, (node: PeerNode) => { let state = CurrentRouterTransitionState() if (state) { diff --git a/arkoala-arkts/arkui/src/ArkCustomComponent.ts b/arkoala-arkts/arkui/src/ArkCustomComponent.ts index 3f494f42e..f912eed02 100644 --- a/arkoala-arkts/arkui/src/ArkCustomComponent.ts +++ b/arkoala-arkts/arkui/src/ArkCustomComponent.ts @@ -51,6 +51,7 @@ export interface ArkCustomComponent { onPlaceChildren/* ? */(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void onMeasure/* ? */(children: Array, constraint: ConstraintSizeOptions): void onMeasureSize/* ? */(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult + isLayoutComponent/* ? */(): boolean onPageShow/* ? */(): void onPageHide/* ? */(): void onFormRecycle/* ? */(): string @@ -67,6 +68,7 @@ export interface ArkCustomComponent { } export class ArkCustomComponentImpl implements ArkCustomComponent { + isLayoutComponent_: boolean = true; /** @memo */ build(): void { } @@ -83,11 +85,25 @@ export class ArkCustomComponentImpl implements ArkCustomComponent { onLayout(children: Array, constraint: ConstraintSizeOptions): void { } onPlaceChildren(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void { + this.isLayoutComponent_ = false; } onMeasure(children: Array, constraint: ConstraintSizeOptions): void { } onMeasureSize(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult { - throw new Error("Unexpected use of base class method") + this.isLayoutComponent_ = false; + return { width: 0, height: 0 } + } + isLayoutComponent(): boolean { + let fakeSelfLayoutInfo: GeometryInfo = { width: 0, height: 0, borderWidth: {}, padding: {}, margin: {} }; + let fakeMeasurableArr: Array = []; + let fakeLayoutableArr: Array = []; + let fakeConstraint: ConstraintSizeOptions = {}; + this.onMeasureSize(fakeSelfLayoutInfo, fakeMeasurableArr, fakeConstraint); + if (!this.isLayoutComponent_) { + return false; + } + this.onPlaceChildren(fakeSelfLayoutInfo, fakeLayoutableArr, fakeConstraint); + return this.isLayoutComponent_; } onPageShow(): void { } diff --git a/arkoala-arkts/arkui/src/ets/ArkComponentRoot.ets b/arkoala-arkts/arkui/src/ets/ArkComponentRoot.ets index 269b60413..fab7f3ca0 100644 --- a/arkoala-arkts/arkui/src/ets/ArkComponentRoot.ets +++ b/arkoala-arkts/arkui/src/ets/ArkComponentRoot.ets @@ -16,7 +16,7 @@ import { memo, memo_intrinsic, memo_entry, memo_stable, memo_skip } from "@koala import { mutableState, MutableState, NodeAttach, rememberDisposable, remember, RunEffect, scheduleCallback } from "@koalaui/runtime" import { PeerNode } from "./PeerNode"; -import { ArkComponentRootPeer } from "./generated"; +import { ArkComponentRootPeer, ArkCustomLayoutRootPeer, ConstraintSizeOptions, GeometryInfo, Layoutable, Measurable, SizeResult } from "./generated"; import { ArkCustomComponent } from "./ArkCustomComponent" import { int32 } from "@koalaui/common" import { CurrentRouterTransitionState, RouterTransitionVisibility } from "./handwritten/Router"; @@ -35,7 +35,21 @@ export function ArkComponentRoot( content: () => void ) { NodeAttach( - () => ArkComponentRootPeer.create(), + () => { + if (component.isLayoutComponent()) { + let peer = ArkCustomLayoutRootPeer.create(undefined) + peer.subscribeOnMeasureSizeAttribute((selfLayoutInfo: GeometryInfo, children: Array, + constraint: ConstraintSizeOptions): SizeResult => { + return component.onMeasureSize(selfLayoutInfo, children, constraint) + }) + peer.subscribeOnPlaceChildrenAttribute((selfLayoutInfo: GeometryInfo, children: Array, + constraint: ConstraintSizeOptions) => { + component.onPlaceChildren(selfLayoutInfo, children, constraint) + }) + return peer; + } + return ArkComponentRootPeer.create(undefined) + }, (node: PeerNode) => { let state = CurrentRouterTransitionState() if (state) { diff --git a/arkoala-arkts/arkui/src/ets/ArkCustomComponent.ets b/arkoala-arkts/arkui/src/ets/ArkCustomComponent.ets index 2436d536b..c29ac0630 100644 --- a/arkoala-arkts/arkui/src/ets/ArkCustomComponent.ets +++ b/arkoala-arkts/arkui/src/ets/ArkCustomComponent.ets @@ -52,6 +52,7 @@ export interface ArkCustomComponent { onPlaceChildren/* ? */(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void onMeasure/* ? */(children: Array, constraint: ConstraintSizeOptions): void onMeasureSize/* ? */(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult + isLayoutComponent/* ? */(): boolean onPageShow/* ? */(): void onPageHide/* ? */(): void onFormRecycle/* ? */(): string @@ -68,6 +69,7 @@ export interface ArkCustomComponent { } export class ArkCustomComponentImpl implements ArkCustomComponent { + private isLayoutComponent_: boolean = true; @memo build(): void { } @@ -84,11 +86,25 @@ export class ArkCustomComponentImpl implements ArkCustomComponent { onLayout(children: Array, constraint: ConstraintSizeOptions): void { } onPlaceChildren(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): void { + this.isLayoutComponent_ = false; } onMeasure(children: Array, constraint: ConstraintSizeOptions): void { } onMeasureSize(selfLayoutInfo: GeometryInfo, children: Array, constraint: ConstraintSizeOptions): SizeResult { - throw new Error("Unexpected use of base class method") + this.isLayoutComponent_ = false; + return { width: 0, height: 0 } + } + isLayoutComponent(): boolean { + let fakeSelfLayoutInfo: GeometryInfo = { width: 0, height: 0, borderWidth: {}, padding: {}, margin: {} }; + let fakeMeasurableArr: Array = []; + let fakeLayoutableArr: Array = []; + let fakeConstraint: ConstraintSizeOptions = {}; + this.onMeasureSize(fakeSelfLayoutInfo, fakeMeasurableArr, fakeConstraint); + if (!this.isLayoutComponent_) { + return false; + } + this.onPlaceChildren(fakeSelfLayoutInfo, fakeLayoutableArr, fakeConstraint); + return this.isLayoutComponent_; } onPageShow(): void { } -- Gitee