diff --git a/arkoala-cj/framework/cangjie/src/Handwritten.cj b/arkoala-cj/framework/cangjie/src/Handwritten.cj index ca341f5056bcc76457614ec9a4a7aaf470e02adb..d95ff143b852285e9fad08071ae246929bfa845d 100644 --- a/arkoala-cj/framework/cangjie/src/Handwritten.cj +++ b/arkoala-cj/framework/cangjie/src/Handwritten.cj @@ -2,10 +2,40 @@ package idlize import Interop.* +public type CustomNodeBuilder = (parentNode: Int64) -> Int64 + + public interface AttributeModifier {} +public interface GestureModifier {} public interface ContentModifier {} +public func hookButtonContentModifier( + receiver: Object, value: ContentModifier) {} public func hookCheckBoxContentModifier( - receiver: ArkCheckboxComponent, value: ?ContentModifier) { - InteropNativeModule._NativeLog("hookCheckBoxContentModifier is not implemented for arkoala") -} + receiver: Object, value: ContentModifier) {} +public func hookDataPanelContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookGaugeContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookLoadingProgressContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookProgressContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookRadioContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookRatingContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookSelectContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookSliderContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookTextClockContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookTextTimerContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookToggleContentModifier( + receiver: Object, value: ContentModifier) {} +public func hookGestureModifier(receiver: Object, value: Option) {} +public func hookStateStyleImpl(receiver: Any, value: Any) {} +public func hookId(component: Object, value: Option) {} + diff --git a/arkoala-cj/framework/cangjie/src/Main.cj b/arkoala-cj/framework/cangjie/src/Main.cj index 58842a6dde827cbaf30ed5eb743a582c6b2aacae..e806a086ca234fa4aa4f38f3cc1da576dceeaeab 100644 --- a/arkoala-cj/framework/cangjie/src/Main.cj +++ b/arkoala-cj/framework/cangjie/src/Main.cj @@ -76,7 +76,7 @@ func checkPerf2(count: Int64) { func checkPerf3(count: Int32): Unit { var peer = ArkButtonPeer.create(None, 0) - var testLength_10_lpx = Length("10lpx") + var testLength_10_lpx = Union_Length_LayoutPolicy(Length("10lpx")) let start = DateTime.now().nanosecond for (i in 0..count) { peer.setWidthAttribute(testLength_10_lpx); @@ -92,28 +92,28 @@ func peersTest(): Unit { let labelStyle = LabelStyle(Option.None, 5.0, Option.None, Option.None, Option.None, Option.None) checkResult("[Interface + Optional] ButtonPeer.labelStyle", { => buttonPeer.setLabelStyleAttribute(labelStyle) }, - "setLabelStyle({.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_OBJECT, .value={.tag=102, .i32=5}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_UNDEFINED, .value={}}}) \n") + "setLabelStyle({.tag=INTEROP_TAG_OBJECT, .value={.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_OBJECT, .value={.tag=102, .i32=5}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}) \n") // union labelStyle.maxLines = Option.None labelStyle.font = Font(Option.None, Union_FontWeight_Number_String("param"), Option.None, Option.None) checkResult("[Union] ButtonPeer.labelStyle", { => buttonPeer.setLabelStyleAttribute(labelStyle) }, - "setLabelStyle({.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_OBJECT, .value={.selector=2, .value2={.chars=\"param\", .length=5}}}, .family={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}) \n") + "setLabelStyle({.tag=INTEROP_TAG_OBJECT, .value={.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_OBJECT, .value={.selector=2, .value2={.chars=\"param\", .length=5}}}, .family={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}}) \n") labelStyle.font = Font(Option.None, Union_FontWeight_Number_String(FontWeight.BOLD), Option.None, Option.None) checkResult("[Union + Enum] ButtonPeer.labelStyle", { => buttonPeer.setLabelStyleAttribute(labelStyle) }, - "setLabelStyle({.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_OBJECT, .value={.selector=0, .value0=Ark_FontWeight(4)}}, .family={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}) \n") + "setLabelStyle({.tag=INTEROP_TAG_OBJECT, .value={.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_OBJECT, .value={.selector=0, .value0=Ark_FontWeight(4)}}, .family={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}}) \n") let resource = Resource("bundle_name", "module_name", 10.0, Option.None, 2000.0) labelStyle.font = Font(Option.None, Option.None, Union_String_Resource(resource), Option.None) checkResult("[Union + Resource] ButtonPeer.labelStyle", { => buttonPeer.setLabelStyleAttribute(labelStyle) }, - "setLabelStyle({.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .family={.tag=INTEROP_TAG_OBJECT, .value={.selector=1, .value1={.bundleName={.chars=\"bundle_name\", .length=11}, .moduleName={.chars=\"module_name\", .length=11}, .id={.tag=102, .i32=10}, .params={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .type_={.tag=INTEROP_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}) \n") + "setLabelStyle({.tag=INTEROP_TAG_OBJECT, .value={.overflow={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxLines={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .minFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maxFontSize={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .heightAdaptivePolicy={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .font={.tag=INTEROP_TAG_OBJECT, .value={.size={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .weight={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .family={.tag=INTEROP_TAG_OBJECT, .value={.selector=1, .value1={.bundleName={.chars=\"bundle_name\", .length=11}, .moduleName={.chars=\"module_name\", .length=11}, .id={.tag=102, .i32=10}, .params={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .type={.tag=INTEROP_TAG_OBJECT, .value={.tag=102, .i32=2000}}}}}, .style={.tag=INTEROP_TAG_UNDEFINED, .value={}}}}}}) \n") // tuple let peer = ArkTestPeer.create(Option.None, 0) let options = BlurOptions(Tuple_Number_Number(1.0, 2.0)) checkResult("[Tuple] TestPeer.backdropBlur", { => peer.setBackdropBlurAttribute(42.0, options) }, - "setBackdropBlur({.tag=102, .i32=42}, {.tag=INTEROP_TAG_OBJECT, .value={.grayscale={.value0={.tag=102, .i32=1}, .value1={.tag=102, .i32=2}}}}) \n"); + "setBackdropBlur({.tag=INTEROP_TAG_OBJECT, .value={.tag=102, .i32=42}}, {.tag=INTEROP_TAG_OBJECT, .value={.grayscale={.value0={.tag=102, .i32=1}, .value1={.tag=102, .i32=2}}}}) \n") let tuple1 = Tuple_Number_String_EnumDTS(5.5, "test", EnumDTS.ELEM_1) checkResult("[Tuple + Enum] TestPeer.testTupleNumberStringEnum", { => peer.setTestTupleNumberStringEnumAttribute(tuple1) }, @@ -127,21 +127,6 @@ func peersTest(): Unit { // enum checkResult("[Enum] ButtonPeer.type", { => buttonPeer.setTypeAttribute(ButtonType.CAPSULE) }, "setType(Ark_ButtonType(0)) \n"); - let sheetOptions = SheetOptions(Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - Option.None, - SheetMode.EMBEDDED, - Option.None) - checkResult("[Enum + Interface] ButtonPeer.bindSheet", - { => buttonPeer.setBindSheetAttribute(false, sheetOptions) }, - "setBindSheet(false, {.tag=INTEROP_TAG_OBJECT, .value={.backgroundColor={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .height={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .dragBar={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .maskColor={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .blurStyle={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .showClose={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .preferType={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .title={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .enableOutsideInteractive={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .borderStyle={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .mode={.tag=INTEROP_TAG_UNDEFINED, .value={}}, .uiContext={.tag=INTEROP_TAG_OBJECT, .value={.kind=\"ErrorAny\"}}}}) \n") } class ptrHolder { @@ -363,7 +348,8 @@ main(): Unit { for (i in 0..10) { println("~Incremental state update") root.getValue() - state.setValue(Float64(i/2)) + let newValue = Float64(i/2) + state.setValue(newValue) GlobalStateManager.updateSnapshot() } } \ No newline at end of file