From e77c7568b2567d398aa35df15d2f3e4a8dd154cb Mon Sep 17 00:00:00 2001 From: wjnRance Date: Wed, 16 Jul 2025 10:55:32 +0800 Subject: [PATCH 1/2] symbolglyph modifier Signed-off-by: wjnRance --- .../arkui-ohos/src/SymbolGlyphModifier.ts | 392 ++++++++++++++++++ .../src/component/arkts/type_check.ts | 3 +- .../src/component/arkui-external.ts | 2 - .../arkui-ohos/src/component/common.ts | 3 +- .../arkui-ohos/src/component/menuItem.ts | 2 +- .../src/component/navDestination.ts | 2 +- .../arkui-ohos/src/component/navigation.ts | 3 +- .../src/component/peers/Deserializer.ts | 3 +- .../src/component/peers/Serializer.ts | 3 +- .../arkui-ohos/src/component/search.ts | 2 +- .../arkui-ohos/src/component/select.ts | 3 +- .../arkui-ohos/src/component/symbolglyph.ts | 30 +- .../arkui-ohos/src/component/tabContent.ts | 2 +- .../arkui-ohos/src/component/ts/type_check.ts | 2 +- .../AttributeModifierOpsHandWritten.ts | 43 ++ .../handwritten/NavDestinationHandWritten.ts | 3 +- .../NavDestinationHandWrittenImpl.ts | 3 +- .../src/handwritten/NavigationHandWritten.ts | 3 +- .../handwritten/NavigationHandWrittenImpl.ts | 3 +- .../handwritten/modifiers/ArkSearchNode.ts | 3 +- .../arkui-ohos/src/ohos.arkui.modifier.ts | 2 +- .../arkoala-arkts/components.gni | 1 + 22 files changed, 483 insertions(+), 30 deletions(-) create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts new file mode 100644 index 00000000000..a527a3814ee --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AttributeModifier } from 'arkui/component/common'; +import { SymbolGlyphAttribute } from 'arkui/component/symbolglyph'; +import { RuntimeType } from "@koalaui/interop"; + +import { AttributeUpdateFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { PeerNode } from './PeerNode'; +import { ArkSymbolGlyphPeer, SymbolEffect, SymbolEffectStrategy, SymbolRenderingStrategy } from './component/symbolglyph'; +import { FontWeight } from './component/enums'; +import { ResourceColor } from "./component/units"; +import { Resource } from 'global.resource'; + +export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolGlyphAttribute, AttributeModifier { + applyNormalAttribute(instance: SymbolGlyphAttribute): void { } + applyPressedAttribute(instance: SymbolGlyphAttribute): void { } + applyFocusedAttribute(instance: SymbolGlyphAttribute): void { } + applyDisabledAttribute(instance: SymbolGlyphAttribute): void { } + applySelectedAttribute(instance: SymbolGlyphAttribute): void { } + + _fontSize_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontSize0_value?: number | string | Resource | undefined + _fontColor_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontColor0_value?: Array | undefined + _fontWeight_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontWeight0_value?: number | FontWeight | string | undefined + _effectStrategy_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _effectStrategy0_value?: SymbolEffectStrategy | undefined + _renderingStrategy_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _renderingStrategy0_value?: SymbolRenderingStrategy | undefined + _minFontScale_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _minFontScale0_value?: number | Resource | undefined + _maxFontScale_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _maxFontScale0_value?: number | Resource | undefined + _symbolEffect_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _symbolEffect0_value?: SymbolEffect | undefined + _symbolEffect1_value?: boolean | number | undefined + + public fontSize(value: number | string | Resource | undefined): this { + if (this._fontSize_flag === AttributeUpdateFlag.INITIAL || + this._fontSize0_value !== value || !Type.of(value).isPrimitive()) { + this._fontSize0_value = value + this._fontSize_flag = AttributeUpdateFlag.UPDATE + } else { + this._fontSize_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public fontColor(value: Array | undefined): this { + if (this._fontColor_flag === AttributeUpdateFlag.INITIAL || + this._fontColor0_value !== value || !Type.of(value).isPrimitive()) { + this._fontColor0_value = value + this._fontColor_flag = AttributeUpdateFlag.UPDATE + } else { + this._fontColor_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public fontWeight(value: number | FontWeight | string | undefined): this { + if (this._fontWeight_flag === AttributeUpdateFlag.INITIAL || this._fontWeight0_value !== value) { + this._fontWeight0_value = value + this._fontWeight_flag = AttributeUpdateFlag.UPDATE + } else { + this._fontWeight_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public effectStrategy(value: SymbolEffectStrategy | undefined): this { + if (this._effectStrategy_flag === AttributeUpdateFlag.INITIAL || this._effectStrategy0_value !== value) { + this._effectStrategy0_value = value + this._effectStrategy_flag = AttributeUpdateFlag.UPDATE + } else { + this._effectStrategy_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public renderingStrategy(value: SymbolRenderingStrategy | undefined): this { + if (this._renderingStrategy_flag === AttributeUpdateFlag.INITIAL || this._renderingStrategy0_value !== value) { + this._renderingStrategy0_value = value + this._renderingStrategy_flag = AttributeUpdateFlag.UPDATE + } else { + this._renderingStrategy_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public minFontScale(value: number | Resource | undefined): this { + if (this._minFontScale_flag === AttributeUpdateFlag.INITIAL || + this._minFontScale0_value !== value || !Type.of(value).isPrimitive()) { + this._minFontScale0_value = value + this._minFontScale_flag = AttributeUpdateFlag.UPDATE + } else { + this._minFontScale_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public maxFontScale(value: number | Resource | undefined): this { + if (this._maxFontScale_flag === AttributeUpdateFlag.INITIAL || + this._maxFontScale0_value !== value || !Type.of(value).isPrimitive()) { + this._maxFontScale0_value = value + this._maxFontScale_flag = AttributeUpdateFlag.UPDATE + } else { + this._maxFontScale_flag = AttributeUpdateFlag.SKIP + } + return this + } + + public symbolEffect(symbolEffect: SymbolEffect | undefined, isActive?: boolean | number): this { + if (this._symbolEffect_flag === AttributeUpdateFlag.INITIAL || this._symbolEffect0_value !== symbolEffect || + this._symbolEffect1_value !== isActive || !Type.of(symbolEffect).isPrimitive()) { + this._symbolEffect0_value = symbolEffect + this._symbolEffect1_value = isActive + this._symbolEffect_flag = AttributeUpdateFlag.UPDATE + } else { + this._symbolEffect_flag = AttributeUpdateFlag.SKIP + } + return this + } + + applyModifierPatch(value: PeerNode): void { + super.applyModifierPatch(value) + const peerNode: ArkSymbolGlyphPeer = value as ArkSymbolGlyphPeer + if (this._fontSize_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._fontSize_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.fontSizeAttribute((this._fontSize0_value as number | string | Resource | undefined)) + this._fontSize_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._fontSize_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._fontSize_flag = AttributeUpdateFlag.INITIAL + peerNode.fontSizeAttribute(undefined) + } + } + } + if (this._fontColor_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._fontColor_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.fontColorAttribute((this._fontColor0_value as Array | undefined)) + this._fontColor_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._fontColor_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._fontColor_flag = AttributeUpdateFlag.INITIAL + peerNode.fontColorAttribute(undefined) + } + } + } + if (this._fontWeight_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._fontWeight_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.fontWeightAttribute((this._fontWeight0_value as number | FontWeight | string | undefined)) + this._fontWeight_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._fontWeight_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._fontWeight_flag = AttributeUpdateFlag.INITIAL + peerNode.fontWeightAttribute(undefined) + } + } + } + if (this._effectStrategy_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._effectStrategy_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.effectStrategyAttribute((this._effectStrategy0_value as SymbolEffectStrategy | undefined)) + this._effectStrategy_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._effectStrategy_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._effectStrategy_flag = AttributeUpdateFlag.INITIAL + peerNode.effectStrategyAttribute(undefined) + } + } + } + if (this._renderingStrategy_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._renderingStrategy_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.renderingStrategyAttribute((this._renderingStrategy0_value as SymbolRenderingStrategy | undefined)) + this._renderingStrategy_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._renderingStrategy_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._renderingStrategy_flag = AttributeUpdateFlag.INITIAL + peerNode.renderingStrategyAttribute(undefined) + } + } + } + if (this._minFontScale_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._minFontScale_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.minFontScaleAttribute((this._minFontScale0_value as number | Resource | undefined)) + this._minFontScale_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._minFontScale_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._minFontScale_flag = AttributeUpdateFlag.INITIAL + peerNode.minFontScaleAttribute(undefined) + } + } + } + if (this._maxFontScale_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._maxFontScale_flag) { + case AttributeUpdateFlag.UPDATE: { + peerNode.maxFontScaleAttribute((this._maxFontScale0_value as number | Resource | undefined)) + this._maxFontScale_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._maxFontScale_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._maxFontScale_flag = AttributeUpdateFlag.INITIAL + peerNode.maxFontScaleAttribute(undefined) + } + } + } + if (this._symbolEffect_flag !== AttributeUpdateFlag.INITIAL) { + switch (this._symbolEffect_flag) { + case AttributeUpdateFlag.UPDATE: { + if (RuntimeType.BOOLEAN == this._symbolEffect1_value) { + const symbolEffect_casted = this._symbolEffect0_value as (SymbolEffect | undefined) + const isActive_casted = this._symbolEffect1_value as Object as (boolean | undefined) + peerNode.symbolEffect0Attribute(symbolEffect_casted, isActive_casted) + } else if (RuntimeType.NUMBER == this._symbolEffect1_value) { + const symbolEffect_casted = this._symbolEffect0_value as (SymbolEffect | undefined) + const triggerValue_casted = this._symbolEffect1_value as Object as (number | undefined) + peerNode.symbolEffect1Attribute(symbolEffect_casted, triggerValue_casted) + } else { + const symbolEffect_casted = this._symbolEffect0_value as (SymbolEffect | undefined) + peerNode.symbolEffect0Attribute(symbolEffect_casted, undefined) + } + this._symbolEffect_flag = AttributeUpdateFlag.RESET + break + } + case AttributeUpdateFlag.SKIP: { + this._symbolEffect_flag = AttributeUpdateFlag.RESET + break + } + default: { + this._symbolEffect_flag = AttributeUpdateFlag.INITIAL + peerNode.symbolEffect0Attribute(undefined, undefined) + } + } + } + } + + mergeModifier(value: CommonMethodModifier): void { + super.mergeModifier(value) + if (value instanceof SymbolGlyphModifier) { + const symbolGlyphModifier = value as SymbolGlyphModifier; + if (symbolGlyphModifier._fontSize_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._fontSize_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.fontSize(symbolGlyphModifier._fontSize0_value) + break + } + default: { + this.fontSize(undefined) + } + } + } + if (symbolGlyphModifier._fontColor_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._fontColor_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.fontColor(symbolGlyphModifier._fontColor0_value) + break + } + default: { + this.fontColor(undefined) + } + } + } + if (symbolGlyphModifier._fontWeight_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._fontWeight_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.fontWeight(symbolGlyphModifier._fontWeight0_value) + break + } + default: { + this.fontWeight(undefined) + } + } + } + if (symbolGlyphModifier._effectStrategy_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._effectStrategy_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.effectStrategy(symbolGlyphModifier._effectStrategy0_value) + break + } + default: { + this.effectStrategy(undefined) + } + } + } + if (symbolGlyphModifier._renderingStrategy_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._renderingStrategy_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.renderingStrategy(symbolGlyphModifier._renderingStrategy0_value) + break + } + default: { + this.renderingStrategy(undefined) + } + } + } + if (symbolGlyphModifier._minFontScale_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._minFontScale_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.minFontScale(symbolGlyphModifier._minFontScale0_value) + break + } + default: { + this.minFontScale(undefined) + } + } + } + if (symbolGlyphModifier._maxFontScale_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._maxFontScale_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.maxFontScale(symbolGlyphModifier._maxFontScale0_value) + break + } + default: { + this.maxFontScale(undefined) + } + } + } + if (symbolGlyphModifier._symbolEffect_flag !== AttributeUpdateFlag.INITIAL) { + switch (symbolGlyphModifier._symbolEffect_flag) { + case AttributeUpdateFlag.UPDATE: + case AttributeUpdateFlag.SKIP: { + this.symbolEffect(symbolGlyphModifier._symbolEffect0_value, symbolGlyphModifier._symbolEffect1_value) + break + } + default: { + this.symbolEffect(undefined, undefined) + } + } + } + } + } +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/type_check.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/type_check.ts index 4587e18a81b..95d74c5545d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/type_check.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/type_check.ts @@ -32,7 +32,8 @@ import { BadgePosition, BadgeStyle, BadgeParamWithNumber, BadgeParam, BadgeParam import { BarrierDirection, LocalizedBarrierDirection, BarrierStyle, GuideLinePosition, GuideLineStyle, LocalizedBarrierStyle } from "./../relativeContainer" import { BarStyle, LaunchMode, NavBarPosition, NavigationMenuItem, ToolbarItem, NavigationOperation, NavigationTitleOptions, NavigationMenuOptions, NavigationToolbarOptions, NavigationAttribute, Tuple_Dimension_Dimension, NavigationMode, NavigationTitleMode, Callback_NavigationTitleMode_Void, Callback_Boolean_Void, Callback_NavigationMode_Void, Callback_String_Opt_Object_Void, Type_NavigationAttribute_customNavContentTransition_delegate, NavContentInfo, NavigationAnimatedTransition, NavigationCommonTitle, NavigationCustomTitle, NavPathInfo, NavPathStack, NavigationOptions, Callback_PopInfo_Void, PopInfo, NavigationInterception, ToolbarItemStatus, Callback_NavigationTransitionProxy_Void, NavigationTransitionProxy, InterceptionShowCallback, NavBar, InterceptionModeCallback, MoreButtonOptions } from "./../navigation" import { IntentionCode } from '@ohos.multimodalInput.intentionCode' -import { BaseShape, CircleShape, ShapeSize, CommonShape, WebviewController, Summary, EllipseShape, ImageModifier, RectWidthStyle, RectHeightStyle, SymbolGlyphModifier, PathShape, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { BaseShape, CircleShape, ShapeSize, CommonShape, WebviewController, Summary, EllipseShape, ImageModifier, RectWidthStyle, RectHeightStyle, PathShape, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { SymbolGlyphModifier } from "../../SymbolGlyphModifier" import { ReplaceSymbolEffect, ScaleSymbolEffect, SymbolEffect, EffectDirection, EffectScope } from "../symbolglyph" import { FontOptions, FontInfo, UIFontAdjustInfo, UIFontAliasInfo, UIFontFallbackInfo, UIFontConfig, UIFontGenericInfo, UIFontFallbackGroupInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-external.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-external.ts index 5a69e1006a7..bcc4e2d0b83 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-external.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-external.ts @@ -1042,8 +1042,6 @@ export enum WindowStatusType { } export interface ImageModifier { } -export interface SymbolGlyphModifier { -} export interface IndicatorStyle { height?: Length; width?: Length; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts index 29fcc4a5ec0..a0811859d07 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts @@ -29,7 +29,8 @@ import { Context, ContextInternal, StateStylesOps } from "./arkui-custom" import { ComponentContent } from 'arkui/ComponentContent' import { UIContext } from "@ohos/arkui/UIContext" import { IntentionCode } from '@ohos.multimodalInput.intentionCode' -import { CircleShape, EllipseShape, PathShape, RectShape, SymbolGlyphModifier, ImageModifier } from "./arkui-external" +import { CircleShape, EllipseShape, PathShape, RectShape, ImageModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { KeyType, KeySource, Color, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Visibility, ItemAlign, Direction, ObscuredReasons, RenderFit, FocusDrawLevel, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, LineCapStyle, LineJoinStyle, BarState, CrownSensitivity, EdgeEffect, TextDecorationType, TextDecorationStyle, Curve, PlayMode, SharedTransitionEffectType, GradientDirection, HorizontalAlign, VerticalAlign, TransitionType, FontWeight, FontStyle, TouchType, InteractionHand, CrownAction, Placement, ArrowPointPosition, ClickEffectLevel, NestedScrollMode, PixelRoundCalcPolicy, IlluminatedType, MouseButton, MouseAction, AccessibilityHoverType, AxisAction, AxisModel, ScrollSource } 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, PX, VP, FP, LPX, Percentage, Bias, Font, EdgeStyles, Edges } from "./units" import { Resource } from "global.resource" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/menuItem.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/menuItem.ts index 92551ff6dae..97d70cb11f7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/menuItem.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/menuItem.ts @@ -24,7 +24,7 @@ import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, Bindable } from "./common" import { ResourceStr, Font, ResourceColor } from "./units" -import { SymbolGlyphModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Callback_Boolean_Void } from "./navigation" import { Callback_Opt_Boolean_Void } from "./checkbox" import { Resource } from "global.resource" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navDestination.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navDestination.ts index 5592e56390e..24ddddc57b9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navDestination.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navDestination.ts @@ -29,7 +29,7 @@ import { PeerNode } from "./../PeerNode" import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, LayoutSafeAreaType, LayoutSafeAreaEdge, ArkCommonMethodComponent, ArkCommonMethodStyle, Callback } from "./common" import { ResourceStr, Length } from "./units" import { PixelMap } from "#external" -import { SymbolGlyphModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { SystemBarStyle } from "./arkui-custom" import { Scroller } from "./scroll" import { Resource } from "global.resource" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts index 64963f09689..01ac3ed2881 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts @@ -30,7 +30,8 @@ import { ArkCommonMethodPeer, CommonMethod, CustomBuilder, LayoutSafeAreaType, L import { Length, Dimension, ResourceStr, PX, VP, FP, LPX, Percentage, ResourceColor } from "./units" import { PixelMap } from "#external" import { Resource } from "global.resource" -import { SymbolGlyphModifier, TextModifier } from "./arkui-external" +import { TextModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { SystemBarStyle } from "./arkui-custom" import { NodeAttach, remember } from "@koalaui/runtime" import { TitleHeight } from "./enums" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Deserializer.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Deserializer.ts index d39cb6e6388..62a31dab76f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Deserializer.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Deserializer.ts @@ -62,7 +62,8 @@ import { PageTransitionCallback, RouteType, SlideEffect } from "./../pageTransit import { PasteButtonCallback, PasteButtonOnClickResult, PasteDescription, PasteIconStyle, PasteButtonOptions } from "./../pasteButton" import { PluginErrorCallback, PluginErrorData, PluginComponentTemplate, PluginComponentOptions } from "./../pluginComponent" import { IntentionCode } from '@ohos.multimodalInput.intentionCode' -import { ReceiveCallback, BaseShape, BaseShapeInternal, CircleShape, CircleShapeInternal, ShapeSize, CommonShape, CommonShapeInternal, WebviewController, WebviewControllerInternal, Summary, EllipseShape, EllipseShapeInternal, ImageModifier, RectWidthStyle, RectHeightStyle, SymbolGlyphModifier, PathShape, PathShapeInternal, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeInternal, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, AsyncCallback_image_PixelMap_Void, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { ReceiveCallback, BaseShape, BaseShapeInternal, CircleShape, CircleShapeInternal, ShapeSize, CommonShape, CommonShapeInternal, WebviewController, WebviewControllerInternal, Summary, EllipseShape, EllipseShapeInternal, ImageModifier, RectWidthStyle, RectHeightStyle, PathShape, PathShapeInternal, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeInternal, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, AsyncCallback_image_PixelMap_Void, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { SymbolGlyphModifier } from "../../SymbolGlyphModifier" import { SymbolEffect, SymbolEffectInternal, ReplaceSymbolEffect, ReplaceSymbolEffectInternal, ScaleSymbolEffect, ScaleSymbolEffectInternal } from "../symbolglyph" import { FontOptions, FontInfo, UIFontAdjustInfo, UIFontAliasInfo, UIFontFallbackInfo, UIFontConfig, UIFontGenericInfo, UIFontFallbackGroupInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Serializer.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Serializer.ts index 9d168562bfd..0027dd0cc9b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Serializer.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/Serializer.ts @@ -60,7 +60,8 @@ import { PageTransitionCallback, RouteType, SlideEffect } from "./../pageTransit import { PasteButtonCallback, PasteButtonOnClickResult, PasteDescription, PasteIconStyle, PasteButtonOptions } from "./../pasteButton" import { PluginErrorCallback, PluginErrorData, PluginComponentTemplate, PluginComponentOptions } from "./../pluginComponent" import { IntentionCode } from '@ohos.multimodalInput.intentionCode' -import { ReceiveCallback, BaseShape, BaseShapeInternal, CircleShape, CircleShapeInternal, ShapeSize, CommonShape, CommonShapeInternal, WebviewController, WebviewControllerInternal, Summary, EllipseShape, EllipseShapeInternal, ImageModifier, RectWidthStyle, RectHeightStyle, SymbolGlyphModifier, PathShape, PathShapeInternal, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeInternal, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, AsyncCallback_image_PixelMap_Void, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { ReceiveCallback, BaseShape, BaseShapeInternal, CircleShape, CircleShapeInternal, ShapeSize, CommonShape, CommonShapeInternal, WebviewController, WebviewControllerInternal, Summary, EllipseShape, EllipseShapeInternal, ImageModifier, RectWidthStyle, RectHeightStyle, PathShape, PathShapeInternal, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeInternal, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, AsyncCallback_image_PixelMap_Void, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { SymbolGlyphModifier } from "../../SymbolGlyphModifier" import { SymbolEffect, SymbolEffectInternal, ReplaceSymbolEffect, ReplaceSymbolEffectInternal, ScaleSymbolEffect, ScaleSymbolEffectInternal } from "../symbolglyph" import { FontOptions, FontInfo, UIFontAdjustInfo, UIFontAliasInfo, UIFontFallbackInfo, UIFontConfig, UIFontGenericInfo, UIFontFallbackGroupInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/search.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/search.ts index 6e62fd81786..36a10a87ed0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/search.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/search.ts @@ -24,7 +24,7 @@ import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" import { ArkCommonMethodPeer, Bindable, CommonMethod, TextDecorationOptions, CustomBuilder, ArkCommonMethodComponent, ArkCommonMethodStyle, TextContentControllerBase, TextContentControllerBaseInternal, SelectionOptions } from "./common" import { ResourceColor, Dimension, Font, ResourceStr, PX, VP, FP, LPX, Percentage, Length } from "./units" -import { SymbolGlyphModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Callback_Boolean_Void } from "./navigation" import { CaretStyle, EditableTextOnChangeCallback, PreviewText, TextChangeOptions, InsertValue, DeleteValue, EditMenuOptions, AutoCapitalizationMode, EditableTextChangeValue, KeyboardAppearance } from "./textCommon" import { EnterKeyType, SubmitEvent, OnTextSelectionChangeCallback, OnContentScrollCallback, OnPasteCallback } from "./textInput" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/select.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/select.ts index 2afe3418ed0..1cb6534932f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/select.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/select.ts @@ -18,7 +18,8 @@ import { CommonConfiguration, ContentModifier } from "./arkui-wrapper-builder" import { ResourceStr, Font, ResourceColor, Length, Dimension, DividerStyleOptions, Offset, PX, VP, FP, LPX, Percentage, EdgeOutlineWidths, EdgeColors } from "./units" -import { SymbolGlyphModifier, TextModifier } from "./arkui-external" +import { TextModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Resource } from "global.resource" import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { Finalizable, runtimeType, RuntimeType, SerializerBase, registerCallback, wrapCallback, toPeerPtr, KPointer, MaterializedBase, NativeBuffer, nullptr, KInt, KBoolean, KStringPtr } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/symbolglyph.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/symbolglyph.ts index 15c818495f6..7335bf81d6e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/symbolglyph.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/symbolglyph.ts @@ -22,15 +22,16 @@ import { Serializer } from "./peers/Serializer" import { ComponentBase } from "./../ComponentBase" import { PeerNode } from "./../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" -import { ArkCommonMethodPeer, CommonMethod, ArkCommonMethodComponent, ArkCommonMethodStyle } from "./common" +import { ArkCommonMethodPeer, CommonMethod, ArkCommonMethodComponent, ArkCommonMethodStyle, AttributeModifier, StateStyles } from "./common" import { Resource } from "global.resource" import { ResourceColor } from "./units" import { FontWeight, Color } from "./enums" -import { CallbackKind } from "./peers/CallbackKind" -import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" import { Deserializer } from "./peers/Deserializer" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" +import { hookSymbolGlyphAttributeModifier } from "../handwritten" + export enum EffectDirection { DOWN = 0, UP = 1 @@ -204,6 +205,7 @@ export class ReplaceSymbolEffect extends SymbolEffect implements MaterializedBas } } export class ArkSymbolGlyphPeer extends ArkCommonMethodPeer { + _attributeSet?: SymbolGlyphModifier; protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { super(peerPtr, id, name, flags) } @@ -444,14 +446,15 @@ export enum EffectFillStyle { ITERATIVE = 1 } export interface SymbolGlyphAttribute extends CommonMethod { - fontSize(value: number | string | Resource | undefined): this - fontColor(value: Array | undefined): this - fontWeight(value: number | FontWeight | string | undefined): this - effectStrategy(value: SymbolEffectStrategy | undefined): this - renderingStrategy(value: SymbolRenderingStrategy | undefined): this - minFontScale(value: number | Resource | undefined): this - maxFontScale(value: number | Resource | undefined): this - symbolEffect(symbolEffect: SymbolEffect | undefined, isActive?: boolean | number): this + fontSize(value: number | string | Resource | undefined): this { return this; } + fontColor(value: Array | undefined): this { return this; } + fontWeight(value: number | FontWeight | string | undefined): this { return this; } + effectStrategy(value: SymbolEffectStrategy | undefined): this { return this; } + renderingStrategy(value: SymbolRenderingStrategy | undefined): this { return this; } + minFontScale(value: number | Resource | undefined): this { return this; } + maxFontScale(value: number | Resource | undefined): this { return this; } + symbolEffect(symbolEffect: SymbolEffect | undefined, isActive?: boolean | number): this { return this; } + attributeModifier(value: AttributeModifier | AttributeModifier| undefined): this { return this; } } export class ArkSymbolGlyphStyle extends ArkCommonMethodStyle implements SymbolGlyphAttribute { fontSize_value?: number | string | Resource | undefined @@ -574,6 +577,11 @@ export class ArkSymbolGlyphComponent extends ArkCommonMethodComponent implements } return this } + + public attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this { + hookSymbolGlyphAttributeModifier(this, modifier); + return this + } public applyAttributesFinish(): void { // we call this function outside of class, so need to make it public diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/tabContent.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/tabContent.ts index 65e38f97ca0..87ce32d83fe 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/tabContent.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/tabContent.ts @@ -29,7 +29,7 @@ import { VoidCallback, Length, ResourceColor, ResourceStr, Padding, Dimension, L import { CallbackKind } from "./peers/CallbackKind" import { CallbackTransformer } from "./peers/CallbackTransformer" import { NodeAttach, remember } from "@koalaui/runtime" -import { SymbolGlyphModifier } from "./arkui-external" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { VerticalAlign, TextOverflow, TextHeightAdaptivePolicy } from "./enums" export class ArkTabContentPeer extends ArkCommonMethodPeer { protected constructor(peerPtr: KPointer, id: int32, name: string = "", flags: int32 = 0) { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ts/type_check.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ts/type_check.ts index 3bae5a0ceec..b130abdb542 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ts/type_check.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ts/type_check.ts @@ -32,7 +32,7 @@ import { BadgePosition, BadgeStyle, BadgeParamWithNumber, BadgeParam, BadgeParam import { BarrierDirection, LocalizedBarrierDirection, BarrierStyle, GuideLinePosition, GuideLineStyle, LocalizedBarrierStyle } from "./../relativeContainer" import { BarStyle, LaunchMode, NavBarPosition, NavigationMenuItem, ToolbarItem, NavigationOperation, NavigationTitleOptions, NavigationMenuOptions, NavigationToolbarOptions, NavigationAttribute, Tuple_Dimension_Dimension, NavigationMode, NavigationTitleMode, Callback_NavigationTitleMode_Void, Callback_Boolean_Void, Callback_NavigationMode_Void, Callback_String_Opt_Object_Void, Type_NavigationAttribute_customNavContentTransition_delegate, NavContentInfo, NavigationAnimatedTransition, NavigationCommonTitle, NavigationCustomTitle, NavPathInfo, NavPathStack, NavigationOptions, Callback_PopInfo_Void, PopInfo, NavigationInterception, ToolbarItemStatus, Callback_NavigationTransitionProxy_Void, NavigationTransitionProxy, InterceptionShowCallback, NavBar, InterceptionModeCallback, MoreButtonOptions } from "./../navigation" import { IntentionCode } from '@ohos.multimodalInput.intentionCode' -import { BaseShape, CircleShape, ShapeSize, CommonShape, WebviewController, Summary, EllipseShape, ImageModifier, RectWidthStyle, RectHeightStyle, SymbolGlyphModifier, PathShape, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, SnapshotOptions, LabelStyle } from "./../arkui-external" +import { BaseShape, CircleShape, ShapeSize, CommonShape, WebviewController, Summary, EllipseShape, ImageModifier, RectWidthStyle, RectHeightStyle, PathShape, PathShapeOptions, PerfMonitorActionType, PerfMonitorSourceType, RectShape, RectShapeOptions, RoundRectShapeOptions, ResolutionQuality, TextModifier, IndicatorStyle, WebHeader, WindowStatusType, SnapshotOptions, LabelStyle } from "./../arkui-external" import { ReplaceSymbolEffect, ScaleSymbolEffect, SymbolEffect, EffectDirection, EffectScope } from "../symbolglyph" import { FontOptions, FontInfo, UIFontAdjustInfo, UIFontAliasInfo, UIFontFallbackInfo, UIFontConfig, UIFontGenericInfo, UIFontFallbackGroupInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts index affad1c41ae..14304b8841b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/AttributeModifierOpsHandWritten.ts @@ -16,10 +16,12 @@ import { ArkCommonMethodComponent, AttributeModifier, CommonMethod } from '../component/common'; import { ArkButtonComponent, ButtonAttribute } from '../component/button' import { ArkTextComponent, TextAttribute, ArkTextPeer, TextOptions } from '../component/text' +import { ArkSymbolGlyphComponent, SymbolGlyphAttribute, ArkSymbolGlyphPeer } from '../component/symbolglyph' import { applyAttributeModifierBase, applyCommonModifier } from "./modifiers/ArkCommonModifier"; import { CommonModifier } from '../CommonModifier'; import { TextModifier } from '../TextModifier'; import { ButtonModifier } from "../ButtonModifier"; +import { SymbolGlyphModifier } from '../SymbolGlyphModifier'; import { Resource } from "global.resource" import { runtimeType, RuntimeType } from "@koalaui/interop" export function hookButtonAttributeModifier(component: ArkButtonComponent, modifier: AttributeModifier | AttributeModifier | undefined): void { @@ -104,3 +106,44 @@ export function hookButtonAttributeModifier(component: ArkButtonComponent, modif }; applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); } +export function hookSymbolGlyphAttributeModifier(component: ArkSymbolGlyphComponent, + modifier: AttributeModifier | AttributeModifier | undefined): void { + if (modifier === undefined) { + return; + } + let isCommonModifier: boolean = modifier instanceof CommonModifier; + if (isCommonModifier) { + applyCommonModifier(component.getPeer(), modifier as Object as AttributeModifier); + return; + } + let attributeSet = (): SymbolGlyphModifier => { + let isSymbolGlyphModifier: boolean = modifier instanceof SymbolGlyphModifier; + let initModifier = component.getPeer()._attributeSet ? component.getPeer()._attributeSet! : new SymbolGlyphModifier(); + if (isSymbolGlyphModifier) { + let symbolGlyphModifier = modifier as object as SymbolGlyphModifier; + initModifier.mergeModifier(symbolGlyphModifier); + component.getPeer()._attributeSet = initModifier; + return initModifier; + } else { + component.getPeer()._attributeSet = initModifier; + return initModifier; + } + } + let constructParam = (component: ArkCommonMethodComponent, ...params: FixedArray): void => { + if (params.length > 1) { + throw new Error('more than 1 parameters') + } + let value_casted: Resource | undefined = undefined + if (params.length >= 0) { + value_casted = params[0] as Resource + } + let symbolGlyphPeer: ArkSymbolGlyphPeer = component.getPeer() as Object as ArkSymbolGlyphPeer; + symbolGlyphPeer.setSymbolGlyphOptionsAttribute(value_casted) + }; + let updaterReceiver = (): ArkSymbolGlyphComponent => { + let componentNew: ArkSymbolGlyphComponent = new ArkSymbolGlyphComponent(); + componentNew.setPeer(component.getPeer()); + return componentNew; + }; + applyAttributeModifierBase(modifier as Object as AttributeModifier, attributeSet, constructParam, updaterReceiver, component.getPeer()); +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWritten.ts index fedfd2fb5a5..bad88c6d503 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWritten.ts @@ -14,7 +14,8 @@ */ import { KPointer } from "@koalaui/interop" -import { NavigationTitleOptions, NavDestinationContext, CustomBuilder, NavDestinationCommonTitle, NavDestinationCustomTitle, ResourceStr, SymbolGlyphModifier, Callback } from "../component" +import { NavigationTitleOptions, NavDestinationContext, CustomBuilder, NavDestinationCommonTitle, NavDestinationCustomTitle, ResourceStr, Callback } from "../component" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Resource } from "global.resource" import { PixelMap } from "#external" import { NavDestinationHandWrittenImpl } from "./NavDestinationHandWrittenImpl" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWrittenImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWrittenImpl.ts index c3a1624607e..2b824433764 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWrittenImpl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavDestinationHandWrittenImpl.ts @@ -17,7 +17,8 @@ import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { runtimeType, RuntimeType, KPointer } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { Serializer } from "../component/peers/Serializer" -import { NavigationTitleOptions, NavDestinationContext, CustomBuilder, NavDestinationCommonTitle, NavDestinationCustomTitle, ResourceStr, SymbolGlyphModifier, Callback } from "../component" +import { NavigationTitleOptions, NavDestinationContext, CustomBuilder, NavDestinationCommonTitle, NavDestinationCustomTitle, ResourceStr, Callback } from "../component" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Resource } from "global.resource" import { PixelMap } from "#external" import { CallbackTransformer } from "../component/peers/CallbackTransformer" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWritten.ts index 3d0a9e13287..bfdba1a8630 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWritten.ts @@ -14,7 +14,8 @@ */ import { KPointer } from "@koalaui/interop" -import { NavigationTitleOptions, NavigationMenuOptions, NavigationMenuItem, NavPathStack, ToolbarItem, CustomBuilder, ResourceStr, SymbolGlyphModifier, NavigationToolbarOptions, NavigationCommonTitle, NavigationCustomTitle } from "../component" +import { NavigationTitleOptions, NavigationMenuOptions, NavigationMenuItem, NavPathStack, ToolbarItem, CustomBuilder, ResourceStr, NavigationToolbarOptions, NavigationCommonTitle, NavigationCustomTitle } from "../component" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Resource } from "global.resource" import { PixelMap } from "#external" import { NavigationHandWrittenImpl } from "./NavigationHandWrittenImpl" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWrittenImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWrittenImpl.ts index ef835673210..c0b79bcde96 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWrittenImpl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/NavigationHandWrittenImpl.ts @@ -17,7 +17,8 @@ import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { runtimeType, RuntimeType, KPointer, toPeerPtr } from "@koalaui/interop" import { int32 } from "@koalaui/common" import { Serializer } from "../component/peers/Serializer" -import { NavigationTitleOptions, NavigationMenuOptions, NavigationMenuItem, NavPathStack, ToolbarItem, CustomBuilder, ResourceStr, SymbolGlyphModifier, NavigationToolbarOptions, NavigationCommonTitle, NavigationCustomTitle } from "../component" +import { NavigationTitleOptions, NavigationMenuOptions, NavigationMenuItem, NavPathStack, ToolbarItem, CustomBuilder, ResourceStr, NavigationToolbarOptions, NavigationCommonTitle, NavigationCustomTitle } from "../component" +import { SymbolGlyphModifier } from "../SymbolGlyphModifier" import { Resource } from "global.resource" import { PixelMap } from "#external" import { CallbackTransformer } from "../component/peers/CallbackTransformer" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts index a7af30bd9c4..f8474d8f684 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSearchNode.ts @@ -16,11 +16,12 @@ import { InteropNativeModule } from "@koalaui/interop"; import { ArkBaseNode } from "./ArkBaseNode"; -import { SearchAttribute, ResourceColor, IconOptions, SymbolGlyphModifier, KeyboardOptions, CopyOptions, +import { SearchAttribute, ResourceColor, IconOptions, KeyboardOptions, CopyOptions, TextAlign, SearchSubmitCallback, CancelButtonOptions, CancelButtonSymbolOptions, CaretStyle, Dimension, Font, EnterKeyType, EditableTextOnChangeCallback, OnTextSelectionChangeCallback, OnContentScrollCallback, OnPasteCallback, TextDecorationOptions, SearchType, InsertValue, DeleteValue, EditMenuOptions, AutoCapitalizationMode, EditableTextChangeValue, KeyboardAppearance, SearchButtonOptions, ResourceStr, CustomBuilder } from "../../component"; +import { SymbolGlyphModifier } from "../../SymbolGlyphModifier"; import { ArkSearchPeer, SearchOptions } from "../../component"; import { Resource } from "global.resource" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ohos.arkui.modifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ohos.arkui.modifier.ts index f094d983977..123718f266c 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ohos.arkui.modifier.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ohos.arkui.modifier.ts @@ -41,6 +41,6 @@ export { ButtonModifier } from './ButtonModifier'; // export { TextModifier } from './handwritten/modifiers/ArkTextModifier' -// export { SymbolGlyphModifier } from "./handwritten/modifiers/ArkSymbolGlyphModifier" +export { SymbolGlyphModifier } from "./SymbolGlyphModifier" // export { GridItemModifier } from './handwritten/modifiers/ArkGridItemModifier' \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni index 770b6a2f7ca..9f951657ee4 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -67,6 +67,7 @@ arkui_files = [ "arkui-preprocessed/arkui/RowModifier.ets", "arkui-preprocessed/arkui/RowSplitModifier.ets", "arkui-preprocessed/arkui/StackModifier.ets", + "arkui-preprocessed/arkui/SymbolGlyphModifier.ets", "arkui-preprocessed/arkui/TextModifier.ets", "arkui-preprocessed/arkui/UserView.ets", "arkui-preprocessed/arkui/ani/arkts/ArkUIAniCustomNodeModule.ets", -- Gitee From 9905ecb119ec78030ebe42c13e2fcc7c76a78c97 Mon Sep 17 00:00:00 2001 From: wjnRance Date: Thu, 17 Jul 2025 09:18:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wjnRance --- .../arkui-ohos/src/SymbolGlyphModifier.ts | 210 +++++++++--------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts index a527a3814ee..e4345c43bd1 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/SymbolGlyphModifier.ts @@ -17,7 +17,7 @@ import { AttributeModifier } from 'arkui/component/common'; import { SymbolGlyphAttribute } from 'arkui/component/symbolglyph'; import { RuntimeType } from "@koalaui/interop"; -import { AttributeUpdateFlag, CommonMethodModifier } from './CommonMethodModifier'; +import { AttributeUpdaterFlag, CommonMethodModifier } from './CommonMethodModifier'; import { PeerNode } from './PeerNode'; import { ArkSymbolGlyphPeer, SymbolEffect, SymbolEffectStrategy, SymbolRenderingStrategy } from './component/symbolglyph'; import { FontWeight } from './component/enums'; @@ -31,106 +31,106 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG applyDisabledAttribute(instance: SymbolGlyphAttribute): void { } applySelectedAttribute(instance: SymbolGlyphAttribute): void { } - _fontSize_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontSize_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _fontSize0_value?: number | string | Resource | undefined - _fontColor_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontColor_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _fontColor0_value?: Array | undefined - _fontWeight_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _fontWeight_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _fontWeight0_value?: number | FontWeight | string | undefined - _effectStrategy_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _effectStrategy_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _effectStrategy0_value?: SymbolEffectStrategy | undefined - _renderingStrategy_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _renderingStrategy_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _renderingStrategy0_value?: SymbolRenderingStrategy | undefined - _minFontScale_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _minFontScale_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _minFontScale0_value?: number | Resource | undefined - _maxFontScale_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _maxFontScale_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _maxFontScale0_value?: number | Resource | undefined - _symbolEffect_flag: AttributeUpdateFlag = AttributeUpdateFlag.INITIAL + _symbolEffect_flag: AttributeUpdaterFlag = AttributeUpdaterFlag.INITIAL _symbolEffect0_value?: SymbolEffect | undefined _symbolEffect1_value?: boolean | number | undefined public fontSize(value: number | string | Resource | undefined): this { - if (this._fontSize_flag === AttributeUpdateFlag.INITIAL || + if (this._fontSize_flag === AttributeUpdaterFlag.INITIAL || this._fontSize0_value !== value || !Type.of(value).isPrimitive()) { this._fontSize0_value = value - this._fontSize_flag = AttributeUpdateFlag.UPDATE + this._fontSize_flag = AttributeUpdaterFlag.UPDATE } else { - this._fontSize_flag = AttributeUpdateFlag.SKIP + this._fontSize_flag = AttributeUpdaterFlag.SKIP } return this } public fontColor(value: Array | undefined): this { - if (this._fontColor_flag === AttributeUpdateFlag.INITIAL || + if (this._fontColor_flag === AttributeUpdaterFlag.INITIAL || this._fontColor0_value !== value || !Type.of(value).isPrimitive()) { this._fontColor0_value = value - this._fontColor_flag = AttributeUpdateFlag.UPDATE + this._fontColor_flag = AttributeUpdaterFlag.UPDATE } else { - this._fontColor_flag = AttributeUpdateFlag.SKIP + this._fontColor_flag = AttributeUpdaterFlag.SKIP } return this } public fontWeight(value: number | FontWeight | string | undefined): this { - if (this._fontWeight_flag === AttributeUpdateFlag.INITIAL || this._fontWeight0_value !== value) { + if (this._fontWeight_flag === AttributeUpdaterFlag.INITIAL || this._fontWeight0_value !== value) { this._fontWeight0_value = value - this._fontWeight_flag = AttributeUpdateFlag.UPDATE + this._fontWeight_flag = AttributeUpdaterFlag.UPDATE } else { - this._fontWeight_flag = AttributeUpdateFlag.SKIP + this._fontWeight_flag = AttributeUpdaterFlag.SKIP } return this } public effectStrategy(value: SymbolEffectStrategy | undefined): this { - if (this._effectStrategy_flag === AttributeUpdateFlag.INITIAL || this._effectStrategy0_value !== value) { + if (this._effectStrategy_flag === AttributeUpdaterFlag.INITIAL || this._effectStrategy0_value !== value) { this._effectStrategy0_value = value - this._effectStrategy_flag = AttributeUpdateFlag.UPDATE + this._effectStrategy_flag = AttributeUpdaterFlag.UPDATE } else { - this._effectStrategy_flag = AttributeUpdateFlag.SKIP + this._effectStrategy_flag = AttributeUpdaterFlag.SKIP } return this } public renderingStrategy(value: SymbolRenderingStrategy | undefined): this { - if (this._renderingStrategy_flag === AttributeUpdateFlag.INITIAL || this._renderingStrategy0_value !== value) { + if (this._renderingStrategy_flag === AttributeUpdaterFlag.INITIAL || this._renderingStrategy0_value !== value) { this._renderingStrategy0_value = value - this._renderingStrategy_flag = AttributeUpdateFlag.UPDATE + this._renderingStrategy_flag = AttributeUpdaterFlag.UPDATE } else { - this._renderingStrategy_flag = AttributeUpdateFlag.SKIP + this._renderingStrategy_flag = AttributeUpdaterFlag.SKIP } return this } public minFontScale(value: number | Resource | undefined): this { - if (this._minFontScale_flag === AttributeUpdateFlag.INITIAL || + if (this._minFontScale_flag === AttributeUpdaterFlag.INITIAL || this._minFontScale0_value !== value || !Type.of(value).isPrimitive()) { this._minFontScale0_value = value - this._minFontScale_flag = AttributeUpdateFlag.UPDATE + this._minFontScale_flag = AttributeUpdaterFlag.UPDATE } else { - this._minFontScale_flag = AttributeUpdateFlag.SKIP + this._minFontScale_flag = AttributeUpdaterFlag.SKIP } return this } public maxFontScale(value: number | Resource | undefined): this { - if (this._maxFontScale_flag === AttributeUpdateFlag.INITIAL || + if (this._maxFontScale_flag === AttributeUpdaterFlag.INITIAL || this._maxFontScale0_value !== value || !Type.of(value).isPrimitive()) { this._maxFontScale0_value = value - this._maxFontScale_flag = AttributeUpdateFlag.UPDATE + this._maxFontScale_flag = AttributeUpdaterFlag.UPDATE } else { - this._maxFontScale_flag = AttributeUpdateFlag.SKIP + this._maxFontScale_flag = AttributeUpdaterFlag.SKIP } return this } public symbolEffect(symbolEffect: SymbolEffect | undefined, isActive?: boolean | number): this { - if (this._symbolEffect_flag === AttributeUpdateFlag.INITIAL || this._symbolEffect0_value !== symbolEffect || + if (this._symbolEffect_flag === AttributeUpdaterFlag.INITIAL || this._symbolEffect0_value !== symbolEffect || this._symbolEffect1_value !== isActive || !Type.of(symbolEffect).isPrimitive()) { this._symbolEffect0_value = symbolEffect this._symbolEffect1_value = isActive - this._symbolEffect_flag = AttributeUpdateFlag.UPDATE + this._symbolEffect_flag = AttributeUpdaterFlag.UPDATE } else { - this._symbolEffect_flag = AttributeUpdateFlag.SKIP + this._symbolEffect_flag = AttributeUpdaterFlag.SKIP } return this } @@ -138,128 +138,128 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG applyModifierPatch(value: PeerNode): void { super.applyModifierPatch(value) const peerNode: ArkSymbolGlyphPeer = value as ArkSymbolGlyphPeer - if (this._fontSize_flag !== AttributeUpdateFlag.INITIAL) { + if (this._fontSize_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._fontSize_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.fontSizeAttribute((this._fontSize0_value as number | string | Resource | undefined)) - this._fontSize_flag = AttributeUpdateFlag.RESET + this._fontSize_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._fontSize_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._fontSize_flag = AttributeUpdaterFlag.RESET break } default: { - this._fontSize_flag = AttributeUpdateFlag.INITIAL + this._fontSize_flag = AttributeUpdaterFlag.INITIAL peerNode.fontSizeAttribute(undefined) } } } - if (this._fontColor_flag !== AttributeUpdateFlag.INITIAL) { + if (this._fontColor_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._fontColor_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.fontColorAttribute((this._fontColor0_value as Array | undefined)) - this._fontColor_flag = AttributeUpdateFlag.RESET + this._fontColor_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._fontColor_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._fontColor_flag = AttributeUpdaterFlag.RESET break } default: { - this._fontColor_flag = AttributeUpdateFlag.INITIAL + this._fontColor_flag = AttributeUpdaterFlag.INITIAL peerNode.fontColorAttribute(undefined) } } } - if (this._fontWeight_flag !== AttributeUpdateFlag.INITIAL) { + if (this._fontWeight_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._fontWeight_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.fontWeightAttribute((this._fontWeight0_value as number | FontWeight | string | undefined)) - this._fontWeight_flag = AttributeUpdateFlag.RESET + this._fontWeight_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._fontWeight_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._fontWeight_flag = AttributeUpdaterFlag.RESET break } default: { - this._fontWeight_flag = AttributeUpdateFlag.INITIAL + this._fontWeight_flag = AttributeUpdaterFlag.INITIAL peerNode.fontWeightAttribute(undefined) } } } - if (this._effectStrategy_flag !== AttributeUpdateFlag.INITIAL) { + if (this._effectStrategy_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._effectStrategy_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.effectStrategyAttribute((this._effectStrategy0_value as SymbolEffectStrategy | undefined)) - this._effectStrategy_flag = AttributeUpdateFlag.RESET + this._effectStrategy_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._effectStrategy_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._effectStrategy_flag = AttributeUpdaterFlag.RESET break } default: { - this._effectStrategy_flag = AttributeUpdateFlag.INITIAL + this._effectStrategy_flag = AttributeUpdaterFlag.INITIAL peerNode.effectStrategyAttribute(undefined) } } } - if (this._renderingStrategy_flag !== AttributeUpdateFlag.INITIAL) { + if (this._renderingStrategy_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._renderingStrategy_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.renderingStrategyAttribute((this._renderingStrategy0_value as SymbolRenderingStrategy | undefined)) - this._renderingStrategy_flag = AttributeUpdateFlag.RESET + this._renderingStrategy_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._renderingStrategy_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._renderingStrategy_flag = AttributeUpdaterFlag.RESET break } default: { - this._renderingStrategy_flag = AttributeUpdateFlag.INITIAL + this._renderingStrategy_flag = AttributeUpdaterFlag.INITIAL peerNode.renderingStrategyAttribute(undefined) } } } - if (this._minFontScale_flag !== AttributeUpdateFlag.INITIAL) { + if (this._minFontScale_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._minFontScale_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.minFontScaleAttribute((this._minFontScale0_value as number | Resource | undefined)) - this._minFontScale_flag = AttributeUpdateFlag.RESET + this._minFontScale_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._minFontScale_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._minFontScale_flag = AttributeUpdaterFlag.RESET break } default: { - this._minFontScale_flag = AttributeUpdateFlag.INITIAL + this._minFontScale_flag = AttributeUpdaterFlag.INITIAL peerNode.minFontScaleAttribute(undefined) } } } - if (this._maxFontScale_flag !== AttributeUpdateFlag.INITIAL) { + if (this._maxFontScale_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._maxFontScale_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { peerNode.maxFontScaleAttribute((this._maxFontScale0_value as number | Resource | undefined)) - this._maxFontScale_flag = AttributeUpdateFlag.RESET + this._maxFontScale_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._maxFontScale_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._maxFontScale_flag = AttributeUpdaterFlag.RESET break } default: { - this._maxFontScale_flag = AttributeUpdateFlag.INITIAL + this._maxFontScale_flag = AttributeUpdaterFlag.INITIAL peerNode.maxFontScaleAttribute(undefined) } } } - if (this._symbolEffect_flag !== AttributeUpdateFlag.INITIAL) { + if (this._symbolEffect_flag !== AttributeUpdaterFlag.INITIAL) { switch (this._symbolEffect_flag) { - case AttributeUpdateFlag.UPDATE: { + case AttributeUpdaterFlag.UPDATE: { if (RuntimeType.BOOLEAN == this._symbolEffect1_value) { const symbolEffect_casted = this._symbolEffect0_value as (SymbolEffect | undefined) const isActive_casted = this._symbolEffect1_value as Object as (boolean | undefined) @@ -272,15 +272,15 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG const symbolEffect_casted = this._symbolEffect0_value as (SymbolEffect | undefined) peerNode.symbolEffect0Attribute(symbolEffect_casted, undefined) } - this._symbolEffect_flag = AttributeUpdateFlag.RESET + this._symbolEffect_flag = AttributeUpdaterFlag.RESET break } - case AttributeUpdateFlag.SKIP: { - this._symbolEffect_flag = AttributeUpdateFlag.RESET + case AttributeUpdaterFlag.SKIP: { + this._symbolEffect_flag = AttributeUpdaterFlag.RESET break } default: { - this._symbolEffect_flag = AttributeUpdateFlag.INITIAL + this._symbolEffect_flag = AttributeUpdaterFlag.INITIAL peerNode.symbolEffect0Attribute(undefined, undefined) } } @@ -291,10 +291,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG super.mergeModifier(value) if (value instanceof SymbolGlyphModifier) { const symbolGlyphModifier = value as SymbolGlyphModifier; - if (symbolGlyphModifier._fontSize_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._fontSize_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._fontSize_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.fontSize(symbolGlyphModifier._fontSize0_value) break } @@ -303,10 +303,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._fontColor_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._fontColor_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._fontColor_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.fontColor(symbolGlyphModifier._fontColor0_value) break } @@ -315,10 +315,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._fontWeight_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._fontWeight_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._fontWeight_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.fontWeight(symbolGlyphModifier._fontWeight0_value) break } @@ -327,10 +327,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._effectStrategy_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._effectStrategy_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._effectStrategy_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.effectStrategy(symbolGlyphModifier._effectStrategy0_value) break } @@ -339,10 +339,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._renderingStrategy_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._renderingStrategy_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._renderingStrategy_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.renderingStrategy(symbolGlyphModifier._renderingStrategy0_value) break } @@ -351,10 +351,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._minFontScale_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._minFontScale_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._minFontScale_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.minFontScale(symbolGlyphModifier._minFontScale0_value) break } @@ -363,10 +363,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._maxFontScale_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._maxFontScale_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._maxFontScale_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.maxFontScale(symbolGlyphModifier._maxFontScale0_value) break } @@ -375,10 +375,10 @@ export class SymbolGlyphModifier extends CommonMethodModifier implements SymbolG } } } - if (symbolGlyphModifier._symbolEffect_flag !== AttributeUpdateFlag.INITIAL) { + if (symbolGlyphModifier._symbolEffect_flag !== AttributeUpdaterFlag.INITIAL) { switch (symbolGlyphModifier._symbolEffect_flag) { - case AttributeUpdateFlag.UPDATE: - case AttributeUpdateFlag.SKIP: { + case AttributeUpdaterFlag.UPDATE: + case AttributeUpdaterFlag.SKIP: { this.symbolEffect(symbolGlyphModifier._symbolEffect0_value, symbolGlyphModifier._symbolEffect1_value) break } -- Gitee