浏览代码

Merge pull request #22 from Unity-Technologies/siyaoH/skiaBase

Siyao h/skia base
/siyaoH-1.17-PlatformMessage
GitHub 4 年前
当前提交
1871d52e
共有 327 个文件被更改,包括 1808 次插入1227 次删除
  1. 17
      Samples/UIWidgetsSamples_2019_4/Assets/TextTest.cs
  2. 143
      Samples/UIWidgetsSamples_2019_4/Assets/TextTest.unity
  3. 7
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  4. 8
      com.unity.uiwidgets/Runtime/animation/animation_controller.cs
  5. 3
      com.unity.uiwidgets/Runtime/async/coroutine.cs
  6. 3
      com.unity.uiwidgets/Runtime/async/microtask_queue.cs
  7. 1
      com.unity.uiwidgets/Runtime/async/priority_queue.cs
  8. 3
      com.unity.uiwidgets/Runtime/async/timer.cs
  9. 4
      com.unity.uiwidgets/Runtime/async2/future.cs
  10. 2
      com.unity.uiwidgets/Runtime/async2/schedule_microtask.cs
  11. 14
      com.unity.uiwidgets/Runtime/async2/timer.cs
  12. 4
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs
  13. 4
      com.unity.uiwidgets/Runtime/engine/raycastable/UIWidgetsRaycastablePanel.cs
  14. 53
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
  15. 3
      com.unity.uiwidgets/Runtime/external/RTree.cs
  16. 3
      com.unity.uiwidgets/Runtime/foundation/binding.cs
  17. 9
      com.unity.uiwidgets/Runtime/foundation/debug.cs
  18. 2
      com.unity.uiwidgets/Runtime/foundation/isolates.cs
  19. 22
      com.unity.uiwidgets/Runtime/gestures/binding.cs
  20. 34
      com.unity.uiwidgets/Runtime/gestures/converter.cs
  21. 8
      com.unity.uiwidgets/Runtime/gestures/mouse_tracking.cs
  22. 4
      com.unity.uiwidgets/Runtime/gestures/multidrag.cs
  23. 8
      com.unity.uiwidgets/Runtime/gestures/multitap.cs
  24. 4
      com.unity.uiwidgets/Runtime/gestures/recognizer.cs
  25. 74
      com.unity.uiwidgets/Runtime/material/colors.cs
  26. 71
      com.unity.uiwidgets/Runtime/painting/alignment.cs
  27. 21
      com.unity.uiwidgets/Runtime/painting/binding.cs
  28. 19
      com.unity.uiwidgets/Runtime/painting/box_decoration.cs
  29. 2
      com.unity.uiwidgets/Runtime/painting/colors.cs
  30. 6
      com.unity.uiwidgets/Runtime/painting/decoration_image.cs
  31. 59
      com.unity.uiwidgets/Runtime/painting/gradient.cs
  32. 148
      com.unity.uiwidgets/Runtime/painting/image_provider.cs
  33. 8
      com.unity.uiwidgets/Runtime/painting/image_resolution.cs
  34. 34
      com.unity.uiwidgets/Runtime/painting/image_stream.cs
  35. 36
      com.unity.uiwidgets/Runtime/painting/matrix_utils.cs
  36. 7
      com.unity.uiwidgets/Runtime/painting/shader_warmup.cs
  37. 2
      com.unity.uiwidgets/Runtime/painting/strut_style.cs
  38. 241
      com.unity.uiwidgets/Runtime/painting/text_painter.cs
  39. 190
      com.unity.uiwidgets/Runtime/painting/text_span.cs
  40. 40
      com.unity.uiwidgets/Runtime/painting/text_style.cs
  41. 2
      com.unity.uiwidgets/Runtime/rendering/animated_size.cs
  42. 2
      com.unity.uiwidgets/Runtime/rendering/box.cs
  43. 6
      com.unity.uiwidgets/Runtime/rendering/debug_overflow_indicator.cs
  44. 122
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  45. 18
      com.unity.uiwidgets/Runtime/rendering/image.cs
  46. 216
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  47. 4
      com.unity.uiwidgets/Runtime/rendering/object.cs
  48. 19
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  49. 8
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  50. 2
      com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs
  51. 20
      com.unity.uiwidgets/Runtime/rendering/texture.cs
  52. 4
      com.unity.uiwidgets/Runtime/rendering/view.cs
  53. 12
      com.unity.uiwidgets/Runtime/rendering/viewport_offset.cs
  54. 5
      com.unity.uiwidgets/Runtime/scheduler/binding.cs
  55. 3
      com.unity.uiwidgets/Runtime/scheduler/ticker.cs
  56. 4
      com.unity.uiwidgets/Runtime/scheduler2/binding.cs
  57. 18
      com.unity.uiwidgets/Runtime/service/clipboard.cs
  58. 9
      com.unity.uiwidgets/Runtime/service/keyboard.cs
  59. 182
      com.unity.uiwidgets/Runtime/service/text_editing.cs
  60. 1
      com.unity.uiwidgets/Runtime/service/text_formatter.cs
  61. 4
      com.unity.uiwidgets/Runtime/service/text_input.cs
  62. 2
      com.unity.uiwidgets/Runtime/services/asset_bundle.cs
  63. 2
      com.unity.uiwidgets/Runtime/services/binary_messenger.cs
  64. 2
      com.unity.uiwidgets/Runtime/services/binding.cs
  65. 2
      com.unity.uiwidgets/Runtime/ui2/channel_buffers.cs
  66. 99
      com.unity.uiwidgets/Runtime/ui2/compositing.cs
  67. 2
      com.unity.uiwidgets/Runtime/ui2/hooks.cs
  68. 2
      com.unity.uiwidgets/Runtime/ui2/isolate.cs
  69. 2
      com.unity.uiwidgets/Runtime/ui2/native_bindings.cs
  70. 137
      com.unity.uiwidgets/Runtime/ui2/painting.cs
  71. 4
      com.unity.uiwidgets/Runtime/ui2/text.cs
  72. 179
      com.unity.uiwidgets/Runtime/ui2/window.cs
  73. 2
      com.unity.uiwidgets/Runtime/widgets/animated_size.cs
  74. 1
      com.unity.uiwidgets/Runtime/widgets/animated_switcher.cs
  75. 24
      com.unity.uiwidgets/Runtime/widgets/app.cs
  76. 20
      com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs
  77. 9
      com.unity.uiwidgets/Runtime/widgets/basic.cs
  78. 79
      com.unity.uiwidgets/Runtime/widgets/binding.cs
  79. 21
      com.unity.uiwidgets/Runtime/widgets/dismissible.cs
  80. 28
      com.unity.uiwidgets/Runtime/widgets/editable_text.cs
  81. 15
      com.unity.uiwidgets/Runtime/widgets/focus_manager.cs
  82. 47
      com.unity.uiwidgets/Runtime/widgets/image.cs
  83. 13
      com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs
  84. 42
      com.unity.uiwidgets/Runtime/widgets/localizations.cs
  85. 1
      com.unity.uiwidgets/Runtime/widgets/media_query.cs
  86. 65
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  87. 12
      com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs
  88. 2
      com.unity.uiwidgets/Runtime/widgets/overlay.cs
  89. 13
      com.unity.uiwidgets/Runtime/widgets/overscroll_indicator.cs
  90. 8
      com.unity.uiwidgets/Runtime/widgets/page_view.cs
  91. 105
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  92. 18
      com.unity.uiwidgets/Runtime/widgets/scroll_activity.cs
  93. 2
      com.unity.uiwidgets/Runtime/widgets/scroll_context.cs
  94. 8
      com.unity.uiwidgets/Runtime/widgets/scroll_controller.cs
  95. 12
      com.unity.uiwidgets/Runtime/widgets/scroll_position.cs
  96. 6
      com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs
  97. 17
      com.unity.uiwidgets/Runtime/widgets/scrollable.cs
  98. 25
      com.unity.uiwidgets/Runtime/widgets/selectable_text.cs
  99. 1
      com.unity.uiwidgets/Runtime/widgets/text.cs
  100. 24
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs

17
Samples/UIWidgetsSamples_2019_4/Assets/TextTest.cs


using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.ui2;
using Canvas = Unity.UIWidgets.ui2.Canvas;
using Color = Unity.UIWidgets.ui2.Color;
using Paint = Unity.UIWidgets.ui2.Paint;
using ParagraphBuilder = Unity.UIWidgets.ui2.ParagraphBuilder;
using ParagraphConstraints = Unity.UIWidgets.ui2.ParagraphConstraints;
using ParagraphStyle = Unity.UIWidgets.ui2.ParagraphStyle;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Picture = Unity.UIWidgets.ui2.Picture;
using PictureRecorder = Unity.UIWidgets.ui2.PictureRecorder;
using SceneBuilder = Unity.UIWidgets.ui2.SceneBuilder;
using TextBaseline = Unity.UIWidgets.ui2.TextBaseline;
using TextDecoration = Unity.UIWidgets.ui2.TextDecoration;
using TextDecorationStyle = Unity.UIWidgets.ui2.TextDecorationStyle;
using TextPosition = Unity.UIWidgets.ui2.TextPosition;
using Window = Unity.UIWidgets.ui2.Window;
class TextTest : UIWidgetsPanel
{

143
Samples/UIWidgetsSamples_2019_4/Assets/TextTest.unity


m_Component:
- component: {fileID: 847097469}
- component: {fileID: 847097471}
- component: {fileID: 847097470}
- component: {fileID: 847097472}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged

m_AnchoredPosition: {x: -1.3, y: 0.8}
m_SizeDelta: {x: 483, y: 399}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &847097470
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: db61290d6ca38264995f5749021d562c, type: 3}
m_Name:
m_EditorClassIdentifier:
fonts:
- path: Roboto-BlackItalic.ttf
name: Roboto-RegularB
- path: Roboto-Italic.ttf
name: Roboto-Regular
- path: Ranchers-Regular.ttf
name: ranchers
--- !u!222 &847097471
CanvasRenderer:
m_ObjectHideFlags: 0

m_GameObject: {fileID: 847097468}
m_CullTransparentMesh: 0
--- !u!1 &1140493537
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1140493542}
- component: {fileID: 1140493541}
- component: {fileID: 1140493540}
- component: {fileID: 1140493539}
- component: {fileID: 1140493538}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &1140493538
--- !u!114 &847097472
m_GameObject: {fileID: 1140493537}
m_Enabled: 0
m_GameObject: {fileID: 847097468}
m_Enabled: 1
m_Script: {fileID: 11500000, guid: ff655c85f67513d4d9e0967df8685a48, type: 3}
m_Script: {fileID: 11500000, guid: 84eecb3d75338e24185f4fcd9d813a55, type: 3}
--- !u!64 &1140493539
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140493537}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1140493540
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140493537}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1140493541
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140493537}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1140493542
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140493537}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
fonts: []
devicePixelRatioOverride: 0
hardwareAntiAliasing: 0
--- !u!1 &1548023132
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2122288186
GameObject:

m_Children:
- {fileID: 847097469}
m_Father: {fileID: 0}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

7
com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs


using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using UnityEditor;
using UnityEditor.UI;

public class UIWidgetsPanelEditor : RawImageEditor {
EditorGUILayout.PropertyField(serializedObject.FindProperty("fonts"), true);
serializedObject.ApplyModifiedProperties();
serializedObject.ApplyModifiedProperties();
}
}
}

8
com.unity.uiwidgets/Runtime/animation/animation_controller.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.physics;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Ticker = Unity.UIWidgets.scheduler2.Ticker;
using TickerFuture = Unity.UIWidgets.scheduler2.TickerFuture;
using TickerProvider = Unity.UIWidgets.scheduler2.TickerProvider;
namespace Unity.UIWidgets.animation {
enum _AnimationDirection {

? AnimationStatus.completed
: AnimationStatus.dismissed;
_checkStatusChanged();
return TickerFutureImpl.complete();
return TickerFuture.complete();
}
D.assert(simulationDuration > TimeSpan.Zero);

return true;
});
_ticker.dispose();
_ticker = null;
base.dispose();
}

3
com.unity.uiwidgets/Runtime/async/coroutine.cs


/*
using System;
using System.Collections;
using System.Collections.Generic;

public volatile bool isDone;
}
}
}
}*/

3
com.unity.uiwidgets/Runtime/async/microtask_queue.cs


/*
using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;

}
}
}
}
}*/

1
com.unity.uiwidgets/Runtime/async/priority_queue.cs


using System;
using System.Collections.Generic;

3
com.unity.uiwidgets/Runtime/async/timer.cs


/*
using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;

}
}
}
}
}*/

4
com.unity.uiwidgets/Runtime/async2/future.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.async2 {
public struct FutureOr {

public static implicit operator FutureOr(string v) => value(v);
public static implicit operator FutureOr(byte[] v) => value(v);
public static implicit operator FutureOr(RoutePopDisposition v) => value(v);
public static implicit operator FutureOr(Dictionary<Type, object> v) => value(v);
}
public abstract class Future {

2
com.unity.uiwidgets/Runtime/async2/schedule_microtask.cs


using System;
using System.Runtime.InteropServices;
using AOT;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.async2 {

14
com.unity.uiwidgets/Runtime/async2/timer.cs


using System;
using System.Runtime.InteropServices;
using AOT;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.async2 {

return Zone.current
.createTimer(duration, Zone.current.bindCallbackGuarded(callback));
}
public static Timer create(TimeSpan duration, Action callback) {
return create(duration, () => {
callback.Invoke();
return null;
});
}
public static Timer periodic(TimeSpan duration, ZoneUnaryCallback callback) {

_wakeupTime = wakeupTime;
_milliSeconds = milliSeconds;
_repeating = repeating;
}
public static TimeSpan timespanSinceStartup {
get { return TimeSpan.FromMilliseconds(UIMonoState_timerMillisecondClock()); }
}
internal static _Timer _createTimer(ZoneUnaryCallback callback, int milliSeconds, bool repeating) {

4
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs


using System.Collections.Generic;
/*using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.editor;
using Unity.UIWidgets.external.simplejson;

get { return _windowAdapter; }
}
}
}
}*/

4
com.unity.uiwidgets/Runtime/engine/raycastable/UIWidgetsRaycastablePanel.cs


using Unity.UIWidgets.engine;
/*using Unity.UIWidgets.engine;
using UnityEngine;
namespace Unity.UIWidgets.engine.raycast {

return !RaycastManager.CheckCastThrough(windowHashCode, local);
}
}
}
}*/

53
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs


using System.Runtime.InteropServices;
using AOT;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
using NativeBindings = Unity.UIWidgets.ui2.NativeBindings;
using NativeBindings = Unity.UIWidgets.ui.NativeBindings;
public partial class UIWidgetsPanel : MonoBehaviour {
public partial class UIWidgetsPanel : RawImage{
public class TextFont {
public struct TextFont {
public List<TextFont> fonts;
public TextFont[] fonts;
public class UIWidgetRawImage : RawImage {
UIWidgetsPanel _uiWidgetsPanel;
public float devicePixelRatioOverride;
protected override void OnRectTransformDimensionsChange() {
_uiWidgetsPanel.OnRectTransformDimensionsChange();
}
}
UIWidgetRawImage _rawImage;
RectTransform rectTransform {
get { return _rawImage.rectTransform; }
}
public float hardwareAntiAliasing;
// RectTransform rectTransform {
// get { return rectTransform; }
// }
Canvas canvas {
get { return _rawImage.canvas; }
}
// Canvas canvas {
// get { return canvas; }
// }
Texture texture {
set { _rawImage.texture = value; }
}
// Texture texture {
// set { texture = value; }
// }
public static UIWidgetsPanel current {
get { return Window.instance._panel; }

}
}
void OnEnable() {
_rawImage = gameObject.AddComponent<UIWidgetRawImage>();
protected void OnEnable() {
base.OnEnable();
_recreateRenderTexture(_currentWidth, _currentHeight, _currentDevicePixelRatio);
_handle = GCHandle.Alloc(this);

}
}
protected void OnRectTransformDimensionsChange() {
if (_ptr != IntPtr.Zero) {
protected override void OnRectTransformDimensionsChange() {
if (_ptr != IntPtr.Zero && _renderTexture) {
if (_recreateRenderTexture(_currentWidth, _currentHeight, _currentDevicePixelRatio)) {
UIWidgetsPanel_onRenderTexture(_ptr,
_renderTexture.GetNativeTexturePtr(),

}
protected void OnDisable() {
protected override void OnDisable() {
Input_OnDisable();
UIWidgetsPanel_onDisable(_ptr);

_handle.Free();
_handle = default;
_destroyRenderTexture();
Destroy(_rawImage);
// _destroyRenderTexture();
// Destroy(_rawImage);
base.OnDisable();
}
bool _recreateRenderTexture(int width, int height, float devicePixelRatio) {

3
com.unity.uiwidgets/Runtime/external/RTree.cs


/*
using System;
using System.Collections.Generic;
using System.Linq;

}
}
}
}
}*/

3
com.unity.uiwidgets/Runtime/foundation/binding.cs


using System.Collections;
using System.Collections.Generic;
using developer;
using RSG;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.foundation {
public delegate Future<IDictionary<string, object>>

9
com.unity.uiwidgets/Runtime/foundation/debug.cs


using System;
using System.Diagnostics;
using System.Linq;
using Unity.UIWidgets.editor;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Canvas = Unity.UIWidgets.ui.Canvas;

public static bool debugDisableOpacityLayers = false;
public static bool debugDisablePhysicalShapeLayers = false;
public static bool debugPrintMarkNeedsPaintStacks = false;
public static bool debugCheckIntrinsicSizes = false;

public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
Path path = new Path();
path.fillType = PathFillType.evenOdd;
path.winding(PathWinding.clockwise);
var paint = new Paint {
color = color
};

}
if (needRepaint) {
foreach (var adapter in WindowAdapter.windowAdapters) {
/*foreach (var adapter in WindowAdapter.windowAdapters) {
}
}*/
}
}
}

2
com.unity.uiwidgets/Runtime/foundation/isolates.cs


using System.ComponentModel;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.foundation {
public delegate R ComputeCallback<Q, R>(Q message);

22
com.unity.uiwidgets/Runtime/gestures/binding.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
public new static GestureBinding instance {
get { return (GestureBinding) SchedulerBinding.instance; }
set { SchedulerBinding.instance = value; }
protected override void initInstances() {
base.initInstances();
instance = this;
}
public static GestureBinding instance {
get { return (GestureBinding) Window.instance._binding; }
private set { Window.instance._binding = value; }
Window.instance.onPointerEvent += _handlePointerDataPacket;
Window.instance.onPointerDataPacket += _handlePointerDataPacket;
gestureArena = new GestureArenaManager();
}

foreach (var pointerEvent in PointerEventConverter.expand(packet.data, Window.instance.devicePixelRatio)) {
_pendingPointerEvents.Enqueue(pointerEvent);
}
_flushPointerEventQueue();
}

}
_pendingPointerEvents.Enqueue(
new PointerCancelEvent(timeStamp: Timer.timespanSinceStartup, pointer: pointer));
new PointerCancelEvent(timeStamp: _Timer.timespanSinceStartup, pointer: pointer));
}
void _flushPointerEventQueue() {

34
com.unity.uiwidgets/Runtime/gestures/converter.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.gestures {
class _PointerState {

switch (datum.change) {
case PointerChange.add: {
D.assert(!_pointers.ContainsKey(datum.device));
_PointerState state = _ensureStateForPointer(datum, position);
D.assert(state.lastPosition == position);
yield return new PointerAddedEvent(

}
}
break;
case PointerChange.remove: {
D.assert(_pointers.ContainsKey(datum.device));
_PointerState state = _pointers[datum.device];
if (state.down) {
yield return new PointerCancelEvent(
timeStamp: timeStamp,
pointer: state.pointer,
kind: kind,
device: datum.device,
position: position
);
}
if (position != state.lastPosition) {
yield return new PointerHoverEvent(
timeStamp: timeStamp,
kind: kind,
device: datum.device,
position: position
);
}
_pointers.Remove(datum.device);
yield return new PointerRemovedEvent(
timeStamp: timeStamp,
kind: kind,
device: datum.device,
position: position
);
break;
}
#if UNITY_EDITOR
// case PointerChange.dragFromEditorMove: {
// _PointerState state = _ensureStateForPointer(datum, position);

8
com.unity.uiwidgets/Runtime/gestures/mouse_tracking.cs


using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.gestures {

_scheduleMousePositionCheck();
#if UNITY_EDITOR
_scheduleDragFromEditorMousePositionCheck();
//_scheduleDragFromEditorMousePositionCheck();
#endif
}

PointerExitEvent.fromMouseEvent(_lastMouseEvent[deviceId]));
}
#if UNITY_EDITOR
detachDragFromEditorAnnotation(annotation, deviceId);
//detachDragFromEditorAnnotation(annotation, deviceId);
#endif
}

}
#if UNITY_EDITOR
_handleDragFromEditorEvent(evt, deviceId);
//_handleDragFromEditorEvent(evt, deviceId);
#endif
}

4
com.unity.uiwidgets/Runtime/gestures/multidrag.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

TimeSpan? delay = null)
: base(initialPosition) {
D.assert(delay != null);
_timer = Window.instance.run(delay ?? Constants.kLongPressTimeout, _delayPassed, false);
_timer = Timer.create(delay ?? Constants.kLongPressTimeout, _delayPassed);
}
Timer _timer;

8
com.unity.uiwidgets/Runtime/gestures/multitap.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

class _CountdownZoned {
public _CountdownZoned(TimeSpan duration) {
D.assert(duration != null);
_timer = Window.instance.run(duration, _onTimeout);
_timer = Timer.create(duration, _onTimeout);
}
public bool _timeout = false;

void _startDoubleTapTimer() {
_doubleTapTimer =
_doubleTapTimer
?? Window.instance.run(Constants.kDoubleTapTimeout, _reset);
?? Timer.create(Constants.kDoubleTapTimeout, _reset);
}
void _stopDoubleTapTimer() {

_lastPosition = OffsetPair.fromEventPosition(evt);
startTrackingPointer(handleEvent, evt.transform);
if (longTapDelay > TimeSpan.Zero) {
_timer = Window.instance.run(longTapDelay, () => {
_timer = Timer.create(longTapDelay, () => {
_timer = null;
this.gestureRecognizer._dispatchLongTap(evt.pointer, _lastPosition);
});

4
com.unity.uiwidgets/Runtime/gestures/recognizer.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;

primaryPointer = evt.pointer;
initialPosition = new OffsetPair(local: evt.localPosition, global: evt.position);
if (deadline != null) {
_timer = Window.instance.run(deadline.Value, () => didExceedDeadlineWithEvent(evt));
_timer = Timer.create(deadline.Value, () => didExceedDeadlineWithEvent(evt));
}
}
}

74
com.unity.uiwidgets/Runtime/material/colors.cs


namespace Unity.UIWidgets.material {
public class MaterialColor : ColorSwatch<int> {
public MaterialColor(
long primary,
uint primary,
Dictionary<int, Color> swatch) : base(primary: primary, swatch: swatch) {
}

public class MaterialAccentColor : ColorSwatch<int> {
public MaterialAccentColor(
long primary,
uint primary,
Dictionary<int, Color> swatch) : base(primary: primary, swatch: swatch) {
}

}
);
const long _redPrimaryValue = 0xFFF44336;
const uint _redPrimaryValue = 0xFFF44336;
public static readonly MaterialAccentColor redAccent = new MaterialAccentColor(
_redAccentValue,

}
);
const long _redAccentValue = 0xFFFF5252;
const uint _redAccentValue = 0xFFFF5252;
public static readonly MaterialColor pink = new MaterialColor(
_pinkPrimaryValue,

}
);
const long _pinkPrimaryValue = 0xFFE91E63;
const uint _pinkPrimaryValue = 0xFFE91E63;
public static readonly MaterialAccentColor pinkAccent = new MaterialAccentColor(

}
);
const long _pinkAccentPrimaryValue = 0xFFFF4081;
const uint _pinkAccentPrimaryValue = 0xFFFF4081;
public static readonly MaterialColor purple = new MaterialColor(
_purplePrimaryValue,

}
);
const long _purplePrimaryValue = 0xFF9C27B0;
const uint _purplePrimaryValue = 0xFF9C27B0;
public static readonly MaterialAccentColor purpleAccent = new MaterialAccentColor(
_purpleAccentPrimaryValue,

}
);
const long _purpleAccentPrimaryValue = 0xFFE040FB;
const uint _purpleAccentPrimaryValue = 0xFFE040FB;
public static readonly MaterialColor deepPurple = new MaterialColor(
_deepPurplePrimaryValue,

}
);
const long _deepPurplePrimaryValue = 0xFF673AB7;
const uint _deepPurplePrimaryValue = 0xFF673AB7;
public static readonly MaterialAccentColor deepPurpleAccent = new MaterialAccentColor(
_deepPurpleAccentPrimaryValue,

}
);
const long _deepPurpleAccentPrimaryValue = 0xFF7C4DFF;
const uint _deepPurpleAccentPrimaryValue = 0xFF7C4DFF;
public static readonly MaterialColor indigo = new MaterialColor(

}
);
const long _indigoPrimaryValue = 0xFF3F51B5;
const uint _indigoPrimaryValue = 0xFF3F51B5;
public static readonly MaterialAccentColor indigoAccent = new MaterialAccentColor(
_indigoAccentPrimaryValue,

}
);
const long _indigoAccentPrimaryValue = 0xFF536DFE;
const uint _indigoAccentPrimaryValue = 0xFF536DFE;
public static readonly MaterialColor blue = new MaterialColor(
_bluePrimaryValue,

}
);
const long _bluePrimaryValue = 0xFF2196F3;
const uint _bluePrimaryValue = 0xFF2196F3;
public static readonly MaterialAccentColor blueAccent = new MaterialAccentColor(
_blueAccentPrimaryValue,

}
);
const long _blueAccentPrimaryValue = 0xFF448AFF;
const uint _blueAccentPrimaryValue = 0xFF448AFF;
public static readonly MaterialColor lightBlue = new MaterialColor(
_lightBluePrimaryValue,

}
);
const long _lightBluePrimaryValue = 0xFF03A9F4;
const uint _lightBluePrimaryValue = 0xFF03A9F4;
public static readonly MaterialAccentColor lightBlueAccent = new MaterialAccentColor(
_lightBlueAccentPrimaryValue,

}
);
const long _lightBlueAccentPrimaryValue = 0xFF40C4FF;
const uint _lightBlueAccentPrimaryValue = 0xFF40C4FF;
public static readonly MaterialColor cyan = new MaterialColor(
_cyanPrimaryValue,

}
);
const long _cyanPrimaryValue = 0xFF00BCD4;
const uint _cyanPrimaryValue = 0xFF00BCD4;
public static readonly MaterialAccentColor cyanAccent = new MaterialAccentColor(
_cyanAccentPrimaryValue,

}
);
const long _cyanAccentPrimaryValue = 0xFF18FFFF;
const uint _cyanAccentPrimaryValue = 0xFF18FFFF;
public static readonly MaterialColor teal = new MaterialColor(
_tealPrimaryValue,

}
);
const long _tealPrimaryValue = 0xFF009688;
const uint _tealPrimaryValue = 0xFF009688;
public static readonly MaterialAccentColor tealAccent = new MaterialAccentColor(
_tealAccentPrimaryValue,

}
);
const long _tealAccentPrimaryValue = 0xFF64FFDA;
const uint _tealAccentPrimaryValue = 0xFF64FFDA;
public static readonly MaterialColor green = new MaterialColor(
_greenPrimaryValue,

}
);
const long _greenPrimaryValue = 0xFF4CAF50;
const uint _greenPrimaryValue = 0xFF4CAF50;
public static readonly MaterialAccentColor greenAccent = new MaterialAccentColor(
_greenAccentPrimaryValue,

}
);
const long _greenAccentPrimaryValue = 0xFF69F0AE;
const uint _greenAccentPrimaryValue = 0xFF69F0AE;
public static readonly MaterialColor lightGreen = new MaterialColor(
_lightGreenPrimaryValue,

}
);
const long _lightGreenPrimaryValue = 0xFF8BC34A;
const uint _lightGreenPrimaryValue = 0xFF8BC34A;
public static readonly MaterialAccentColor lightGreenAccent = new MaterialAccentColor(
_lightGreenAccentPrimaryValue,

}
);
const long _lightGreenAccentPrimaryValue = 0xFFB2FF59;
const uint _lightGreenAccentPrimaryValue = 0xFFB2FF59;
public static readonly MaterialColor lime = new MaterialColor(
_limePrimaryValue,

}
);
const long _limePrimaryValue = 0xFFCDDC39;
const uint _limePrimaryValue = 0xFFCDDC39;
public static readonly MaterialAccentColor limeAccent = new MaterialAccentColor(
_limeAccentPrimaryValue,

}
);
const long _limeAccentPrimaryValue = 0xFFEEFF41;
const uint _limeAccentPrimaryValue = 0xFFEEFF41;
public static readonly MaterialColor yellow = new MaterialColor(
_yellowPrimaryValue,

}
);
const long _yellowPrimaryValue = 0xFFFFEB3B;
const uint _yellowPrimaryValue = 0xFFFFEB3B;
public static readonly MaterialAccentColor yellowAccent = new MaterialAccentColor(
_yellowAccentPrimaryValue,

}
);
const long _yellowAccentPrimaryValue = 0xFFFFFF00;
const uint _yellowAccentPrimaryValue = 0xFFFFFF00;
public static readonly MaterialColor amber = new MaterialColor(
_amberPrimaryValue,

}
);
const long _amberPrimaryValue = 0xFFFFC107;
const uint _amberPrimaryValue = 0xFFFFC107;
public static readonly MaterialAccentColor amberAccent = new MaterialAccentColor(
_amberAccentPrimaryValue,

}
);
const long _amberAccentPrimaryValue = 0xFFFFD740;
const uint _amberAccentPrimaryValue = 0xFFFFD740;
public static readonly MaterialColor orange = new MaterialColor(
_orangePrimaryValue,

}
);
const long _orangePrimaryValue = 0xFFFF9800;
const uint _orangePrimaryValue = 0xFFFF9800;
public static readonly MaterialAccentColor orangeAccent = new MaterialAccentColor(
_orangeAccentPrimaryValue,

}
);
const long _orangeAccentPrimaryValue = 0xFFFFAB40;
const uint _orangeAccentPrimaryValue = 0xFFFFAB40;
public static readonly MaterialColor deepOrange = new MaterialColor(
_deepOrangePrimaryValue,

}
);
const long _deepOrangePrimaryValue = 0xFFFF5722;
const uint _deepOrangePrimaryValue = 0xFFFF5722;
public static readonly MaterialAccentColor deepOrangeAccent = new MaterialAccentColor(

}
);
const long _deepOrangeAccentPrimaryValue = 0xFFFF6E40;
const uint _deepOrangeAccentPrimaryValue = 0xFFFF6E40;
public static readonly MaterialColor brown = new MaterialColor(
_brownPrimaryValue,

}
);
const long _brownPrimaryValue = 0xFF795548;
const uint _brownPrimaryValue = 0xFF795548;
public static readonly MaterialColor grey = new MaterialColor(
_greyPrimaryValue,

}
);
const long _greyPrimaryValue = 0xFF9E9E9E;
const uint _greyPrimaryValue = 0xFF9E9E9E;
public static readonly MaterialColor blueGrey = new MaterialColor(
_blueGreyPrimaryValue,

}
);
const long _blueGreyPrimaryValue = 0xFF607D8B;
const uint _blueGreyPrimaryValue = 0xFF607D8B;
public static readonly List<MaterialColor> primaries = new List<MaterialColor> {

71
com.unity.uiwidgets/Runtime/painting/alignment.cs


using System;
using Unity.UIWidgets.foundation;
public abstract class AlignmentGeometry {
public AlignmentGeometry() {
}
float _x { get; }
float _start { get; }
float _y { get; }
// public static AlignmentGeometry add(AlignmentGeometry other) {
// return new _MixedAlignment(
// _x + other._x,
// _start + other._start,
// _y + other._y,
// );
// }
// public abstract AlignmentGeometry operator -();
//
// public abstract AlignmentGeometry operator *(double other);
//
// public abstract AlignmentGeometry operator /(double other);
//
// public abstract AlignmentGeometry operator ~/(double other);
//
// public abstract AlignmentGeometry operator %(double other);
// static AlignmentGeometry lerp(AlignmentGeometry a, AlignmentGeometry b, float t) {
// D.assert(t != null);
// if (a == null && b == null)
// return null;
// if (a == null)
// return b * t;
// if (b == null)
// return a * (1.0 - t);
// if (a is Alignment && b is Alignment)
// return Alignment.lerp(a, b, t);
// if (a is AlignmentDirectional && b is AlignmentDirectional)
// return AlignmentDirectional.lerp(a, b, t);
// return _MixedAlignment(
// ui.lerpDouble(a._x, b._x, t),
// ui.lerpDouble(a._start, b._start, t),
// ui.lerpDouble(a._y, b._y, t),
// );
// }
//
public abstract Alignment resolve(TextDirection? direction);
//
// @override
// String toString() {
// if (_start == 0.0)
// return Alignment._stringify(_x, _y);
// if (_x == 0.0)
// return AlignmentDirectional._stringify(_start, _y);
// return Alignment._stringify(_x, _y) + ' + ' + AlignmentDirectional._stringify(_start, 0.0);
// }
//
// @override
// bool operator ==(Object other) {
// return other is AlignmentGeometry
// && other._x == _x
// && other._start == _start
// && other._y == _y;
// }
//
// @override
// int get hashCode => hashValues(_x, _start, _y);
}
public class Alignment : IEquatable<Alignment> {
public Alignment(float x, float y) {
this.x = x;

21
com.unity.uiwidgets/Runtime/painting/binding.cs


using Unity.UIWidgets.gestures;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using Window = Unity.UIWidgets.ui2.Window;
// protected override void initInstances() {
// base.initInstances();
// instance = this;
// _imageCache = createImageCache();
//
// if (shaderWarmUp != null) {
// shaderWarmUp.execute();
// }
// }
protected override void initInstances() {
base.initInstances();
instance = this;
_imageCache = createImageCache();
if (shaderWarmUp != null) {
shaderWarmUp.execute();
}
}
set { GestureBinding.instance = value; }
set { Window.instance._binding = value; }
}
public static ShaderWarmUp shaderWarmUp = new DefaultShaderWarmUp();

19
com.unity.uiwidgets/Runtime/painting/box_decoration.cs


Rect _rectForCachedBackgroundPaint;
Paint _getBackgroundPaint(Rect rect) {
Paint _getBackgroundPaint(Rect rect, TextDirection textDirection) {
D.assert(rect != null);
D.assert(_decoration.gradient != null || _rectForCachedBackgroundPaint == null);

}
if (_decoration.gradient != null) {
paint.shader = _decoration.gradient.createShader(rect);
paint.shader = _decoration.gradient.createShader(rect, textDirection: textDirection);
_rectForCachedBackgroundPaint = rect;
}

return _cachedBackgroundPaint;
}
void _paintBox(Canvas canvas, Rect rect, Paint paint) {
void _paintBox(Canvas canvas, Rect rect, Paint paint, TextDirection textDirection) {
switch (_decoration.shape) {
case BoxShape.circle:
D.assert(_decoration.borderRadius == null);

}
}
void _paintShadows(Canvas canvas, Rect rect) {
void _paintShadows(Canvas canvas, Rect rect, TextDirection textDirection) {
if (_decoration.boxShadow == null) {
return;
}

Rect bounds = rect.shift(boxShadow.offset).inflate(boxShadow.spreadRadius);
_paintBox(canvas, bounds, paint);
_paintBox(canvas, bounds, paint, textDirection);
void _paintBackgroundColor(Canvas canvas, Rect rect) {
void _paintBackgroundColor(Canvas canvas, Rect rect, TextDirection textDirection) {
_paintBox(canvas, rect, _getBackgroundPaint(rect));
_paintBox(canvas, rect, _getBackgroundPaint(rect, textDirection), textDirection);
}
}

D.assert(configuration.size != null);
Rect rect = offset & configuration.size;
TextDirection textDirection = configuration.textDirection;
_paintShadows(canvas, rect);
_paintBackgroundColor(canvas, rect);
_paintShadows(canvas, rect, textDirection);
_paintBackgroundColor(canvas, rect, textDirection);
_paintBackgroundImage(canvas, rect, configuration);
_decoration.border?.paint(
canvas,

2
com.unity.uiwidgets/Runtime/painting/colors.cs


public class ColorSwatch<T> : Color {
public ColorSwatch(
long primary,
uint primary,
Dictionary<T, Color> swatch) : base(primary) {
_swatch = swatch;
}

6
com.unity.uiwidgets/Runtime/painting/decoration_image.cs


Rect centerSlice = null,
ImageRepeat repeat = ImageRepeat.noRepeat,
bool invertColors = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) {
D.assert(canvas != null);
D.assert(rect != null);

Paint paint = new Paint();
if (colorFilter != null) {
paint.colorFilter = colorFilter;
paint.color = colorFilter.color;
paint.blendMode = colorFilter.blendMode;
paint.filterMode = filterMode;
paint.filterQuality = filterQuality;
}
paint.invertColors = invertColors;

59
com.unity.uiwidgets/Runtime/painting/gradient.cs


using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using Shader = Unity.UIWidgets.ui.Shader;
namespace Unity.UIWidgets.painting {
class _ColorsAndStops {

int index = stops.FindLastIndex((float s) => { return s <= t; });
D.assert(index != -1);
return Color.lerp(colors[index], colors[index + 1],
return Color.lerp(colors[index], colors[index + 1],
(t - stops[index]) / (stops[index + 1] - stops[index]));
}

}
}
public abstract class GradientTransform {
public GradientTransform() {
}
public abstract Matrix4 transform(Rect bounds, TextDirection? textDirection = null);
}
public class GradientRotation : GradientTransform {
public GradientRotation(float radians) {
this.radians = radians;
}
public readonly float radians;
public override
Matrix4 transform(Rect bounds,
TextDirection? textDirection = null
) {
D.assert(bounds != null);
float sinRadians = Mathf.Sin(radians);
float oneMinusCosRadians = 1 - Mathf.Cos(radians);
Offset center = bounds.center;
float originX = sinRadians * center.dy + oneMinusCosRadians * center.dx;
float originY = -sinRadians * center.dx + oneMinusCosRadians * center.dy;
var result = new Matrix4().identity();
result.translate(originX, originY);
result.rotateZ(radians);
return result;
}
}
public abstract class Gradient {
public Gradient(

public readonly List<float> stops;
public readonly GradientTransform transform;
protected List<float> _impliedStops() {
if (stops != null) {
return stops;

return Enumerable.Range(0, colors.Count).Select(i => i * separation).ToList();
}
public abstract PaintShader createShader(Rect rect);
public abstract Shader createShader(Rect rect, TextDirection? textDirection = null);
public abstract Gradient scale(float factor);

D.assert(a != null && b != null);
return t < 0.5 ? a.scale(1.0f - (t * 2.0f)) : b.scale((t - 0.5f) * 2.0f);
}
protected float[] _resolveTransform(Rect bounds, TextDirection? textDirection) {
return transform?.transform(bounds, textDirection: textDirection)?._m4storage;
}
}

public readonly TileMode tileMode;
public override PaintShader createShader(Rect rect) {
public override Shader createShader(Rect rect, TextDirection? textDirection = null) {
tileMode
tileMode, _resolveTransform(rect, textDirection)
);
}

public readonly TileMode tileMode;
public readonly AlignmentGeometry focal;
public readonly float focalRadius;
public override PaintShader createShader(Rect rect) {
public override Shader createShader(Rect rect, TextDirection? textDirection = null) {
tileMode
tileMode,
_resolveTransform(rect, textDirection),
focal == null ? null : focal.resolve(textDirection).withinRect(rect),
focalRadius * rect.shortestSide
);
}

public readonly TileMode tileMode;
public override PaintShader createShader(Rect rect) {
public override Shader createShader(Rect rect, TextDirection? textDirection = null) {
startAngle, endAngle
startAngle, endAngle, _resolveTransform(rect, textDirection)
);
}

148
com.unity.uiwidgets/Runtime/painting/image_provider.cs


using System.Collections;
using System.Collections.Generic;
using System.Text;
using RSG;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Codec = Unity.UIWidgets.ui.Codec;
using Image = Unity.UIWidgets.ui.Image;
using Locale = Unity.UIWidgets.ui.Locale;
using Object = UnityEngine.Object;
using TextDirection = Unity.UIWidgets.ui.TextDirection;
using Window = Unity.UIWidgets.ui.Window;
namespace Unity.UIWidgets.painting {
public class ImageConfiguration : IEquatable<ImageConfiguration> {

public readonly float? devicePixelRatio;
public readonly Locale locale;
public readonly TextDirection textDirection;
public readonly Size size;

}
}
public delegate Future<ui.Codec> DecoderCallback(byte[] bytes, int cacheWidth = 0, int cacheHeight = 0);
public abstract class ImageProvider {
public abstract ImageStream resolve(ImageConfiguration configuration);
}

ImageStream stream = new ImageStream();
T obtainedKey = default;
obtainKey(configuration).Then(key => {
obtainKey(configuration).then_((T key) => {
stream.setCompleter(PaintingBinding.instance.imageCache.putIfAbsent(key, () => load(key)));
}).Catch(ex => {
// TODO : how to load
// stream.setCompleter(PaintingBinding.instance.imageCache.putIfAbsent(key, () => load(key)));
D.assert(false, () => "load image from ImageStream is not implemented yet");
}).catchError(ex => {
UIWidgetsError.reportError(new UIWidgetsErrorDetails(
exception: ex,
library: "services library",

return stream;
}
public IPromise<bool> evict(ImageCache cache = null, ImageConfiguration configuration = null) {
public Future<bool> evict(ImageCache cache = null, ImageConfiguration configuration = null) {
return obtainKey(configuration).Then(key => cache.evict(key));
return obtainKey(configuration).then(key => cache.evict(key)).to<bool>();
protected abstract ImageStreamCompleter load(T key);
protected abstract ImageStreamCompleter load(T assetBundleImageKey, DecoderCallback decode);
protected abstract IPromise<T> obtainKey(ImageConfiguration configuration);
protected abstract Future<T> obtainKey(ImageConfiguration configuration);
}
public class AssetBundleImageKey : IEquatable<AssetBundleImageKey> {

protected AssetBundleImageProvider() {
}
protected override ImageStreamCompleter load(AssetBundleImageKey key) {
protected override ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
codec: _loadAsync(key),
codec: _loadAsync(key, decode),
scale: key.scale,
informationCollector: information => {
information.AppendLine($"Image provider: {this}");

}
IPromise<Codec> _loadAsync(AssetBundleImageKey key) {
var coroutine = Window.instance.startCoroutine(_loadAssetAsync(key));
return coroutine.promise.Then(result => {
if (result == null) {
if (key.bundle == null) {
throw new Exception($"Unable to find asset \"{key.name}\" from Resources folder");
}
Future<Codec> _loadAsync(AssetBundleImageKey key, DecoderCallback decode) {
Object data;
// Hot reload/restart could change whether an asset bundle or key in a
// bundle are available, or if it is a network backed bundle.
try {
data = key.bundle.LoadAsset(key.name);
}
catch (Exception e) {
PaintingBinding.instance.imageCache.evict(key);
throw e;
}
throw new Exception($"Unable to find asset \"{key.name}\" from asset bundle \"{key.bundle}\"");
}
if (result is Texture2D texture) {
return CodecUtils.getCodec(new Image(texture, isAsset: true, bundle: key.bundle));
}
else if (result is TextAsset text) {
var bytes = text.bytes;
if (key.bundle == null) {
Resources.UnloadAsset(text);
}
else {
key.bundle.Unload(text);
}
return CodecUtils.getCodec(bytes);
}
else {
throw new Exception($"Unknown type for asset \"{key.name}\": \"{result.GetType()}\"");
}
});
if (data != null && data is Texture2D textureData) {
return decode(textureData.EncodeToPNG());
}
else {
PaintingBinding.instance.imageCache.evict(key);
throw new Exception("Unable to read data");
}
}
IEnumerator _loadAssetAsync(AssetBundleImageKey key) {

yield return request.asset;
} else {
}
else {
yield return request;
yield return request.asset;
}

if (request.asset) {
yield return request.asset;
} else {
}
else {
yield return request.asset;
}
}

public readonly IDictionary<string, string> headers;
protected override IPromise<NetworkImage> obtainKey(ImageConfiguration configuration) {
return Promise<NetworkImage>.Resolved(this);
protected override Future<NetworkImage> obtainKey(ImageConfiguration configuration) {
return new SynchronousFuture<NetworkImage>(this);
protected override ImageStreamCompleter load(NetworkImage key) {
protected override ImageStreamCompleter load(NetworkImage key, DecoderCallback decode) {
codec: _loadAsync(key),
codec: _loadAsync(key, decode),
scale: key.scale,
informationCollector: information => {
information.AppendLine($"Image provider: {this}");

}
IPromise<Codec> _loadAsync(NetworkImage key) {
var coroutine = Window.instance.startCoroutine(_loadBytes(key));
return coroutine.promise.Then(obj => {
if (obj is byte[] bytes) {
return CodecUtils.getCodec(bytes);
}
Future<Codec> _loadAsync(NetworkImage key, DecoderCallback decode) {
var loaded = _loadBytes(key);
if (loaded.Current is byte[] bytes) {
return decode(bytes);
}
return CodecUtils.getCodec(new Image((Texture2D) obj));
});
throw new Exception("not loaded");
}
IEnumerator _loadBytes(NetworkImage key) {

public readonly float scale;
protected override IPromise<FileImage> obtainKey(ImageConfiguration configuration) {
return Promise<FileImage>.Resolved(this);
protected override Future<FileImage> obtainKey(ImageConfiguration configuration) {
return Future<FileImage>.value(FutureOr.value(this)).to<FileImage>();
protected override ImageStreamCompleter load(FileImage key) {
return new MultiFrameImageStreamCompleter(_loadAsync(key),
protected override ImageStreamCompleter load(FileImage key, DecoderCallback decode) {
return new MultiFrameImageStreamCompleter(_loadAsync(key, decode),
IPromise<Codec> _loadAsync(FileImage key) {
var coroutine = Window.instance.startCoroutine(_loadBytes(key));
return coroutine.promise.Then(obj => {
if (obj is byte[] bytes) {
return CodecUtils.getCodec(bytes);
}
return CodecUtils.getCodec(new Image((Texture2D) obj));
});
Future<Codec> _loadAsync(FileImage key, DecoderCallback decode) {
var loaded = _loadBytes(key);
if (loaded.Current is byte[] bytes) {
return decode(bytes);
}
throw new Exception("not loaded");
}
IEnumerator _loadBytes(FileImage key) {

public readonly float scale;
protected override IPromise<MemoryImage> obtainKey(ImageConfiguration configuration) {
return Promise<MemoryImage>.Resolved(this);
protected override Future<MemoryImage> obtainKey(ImageConfiguration configuration) {
return Future<MemoryImage>.value(FutureOr.value(this)).to<MemoryImage>();
protected override ImageStreamCompleter load(MemoryImage key) {
protected override ImageStreamCompleter load(MemoryImage key, DecoderCallback decode) {
_loadAsync(key),
_loadAsync(key, decode),
IPromise<Codec> _loadAsync(MemoryImage key) {
Future<Codec> _loadAsync(MemoryImage key, DecoderCallback decode) {
return CodecUtils.getCodec(bytes);
return decode(bytes);
}
public bool Equals(MemoryImage other) {

public readonly AssetBundle bundle;
protected override IPromise<AssetBundleImageKey> obtainKey(ImageConfiguration configuration) {
return Promise<AssetBundleImageKey>.Resolved(new AssetBundleImageKey(
protected override Future<AssetBundleImageKey> obtainKey(ImageConfiguration configuration) {
return Future<AssetBundleImageKey>.value(FutureOr.value(new AssetBundleImageKey(
));
))).to<AssetBundleImageKey>();
}
public bool Equals(ExactAssetImage other) {

8
com.unity.uiwidgets/Runtime/painting/image_resolution.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;

public readonly string assetName;
public readonly AssetBundle bundle;
protected override IPromise<AssetBundleImageKey> obtainKey(ImageConfiguration configuration) {
protected override Future<AssetBundleImageKey> obtainKey(ImageConfiguration configuration) {
return Promise<AssetBundleImageKey>.Resolved(key);
return Future<AssetBundleImageKey>.value(FutureOr.value(key)).to<AssetBundleImageKey>();
}
AssetBundle chosenBundle = bundle ? bundle : configuration.bundle;

return Promise<AssetBundleImageKey>.Resolved(key);
return Future<AssetBundleImageKey>.value(FutureOr.value(key)).to<AssetBundleImageKey>();
}
AssetBundleImageKey _loadAsset(AssetBundle bundle, float devicePixelRatio) {

34
com.unity.uiwidgets/Runtime/painting/image_stream.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using SchedulerBinding = Unity.UIWidgets.scheduler.SchedulerBinding;
using SchedulerBinding = Unity.UIWidgets.scheduler2.SchedulerBinding;
namespace Unity.UIWidgets.painting {
public class ImageInfo : IEquatable<ImageInfo> {

}
public class OneFrameImageStreamCompleter : ImageStreamCompleter {
public OneFrameImageStreamCompleter(IPromise<ImageInfo> image,
public OneFrameImageStreamCompleter(Future<ImageInfo> image,
image.Then(result => { setImage(result); }).Catch(err => {
image.then_(result => { setImage(result); }).catchError(err => {
reportError(
context: "resolving a single-frame image stream",
exception: err,

public class MultiFrameImageStreamCompleter : ImageStreamCompleter {
public MultiFrameImageStreamCompleter(
IPromise<Codec> codec,
Future<Codec> codec,
float scale,
InformationCollector informationCollector = null
) {

_informationCollector = informationCollector;
codec.Then((Action<Codec>) _handleCodecReady, ex => {
codec.then_((Action<Codec>) _handleCodecReady, ex => {
reportError(
context: "resolving an image codec",
exception: ex,

return FutureOr.nil;
});
}

TimeSpan delay = _frameDuration.Value - (timestamp - _shownTimestamp.Value);
delay = new TimeSpan((long) (delay.Ticks * scheduler_.timeDilation));
_timer = Window.instance.run(delay, _scheduleAppFrame);
// TODO: time dilation
_timer = Timer.create(delay , ()=> _scheduleAppFrame());
}
bool _isFirstFrame() {

return timestamp - _shownTimestamp >= _frameDuration;
}
void _decodeNextFrameAndSchedule() {
Future _decodeNextFrameAndSchedule() {
_nextFrame = frame;
if (_codec.frameCount == 1) {
_emitFrame(new ImageInfo(image: _nextFrame.image, scale: _scale));
return;
}
return frame.then_(info => {
_nextFrame = info;
if (_codec.frameCount == 1) {
_emitFrame(new ImageInfo(image: _nextFrame.image, scale: _scale));
return;
}
_scheduleAppFrame();
_scheduleAppFrame();
});
}
void _scheduleAppFrame() {

36
com.unity.uiwidgets/Runtime/painting/matrix_utils.cs


static float _max4(float a, float b, float c, float d) {
return Mathf.Max(a, Mathf.Max(b, Mathf.Max(c, d)));
}
public static Matrix4x4 toMatrix4x4(this Matrix3 matrix3) {
var matrix = Matrix4x4.identity;
matrix[0, 0] = matrix3[0]; // row 0
matrix[0, 1] = matrix3[1];
matrix[0, 3] = matrix3[2];
matrix[1, 0] = matrix3[3]; // row 1
matrix[1, 1] = matrix3[4];
matrix[1, 3] = matrix3[5];
matrix[3, 0] = matrix3[6]; // row 2
matrix[3, 1] = matrix3[7];
matrix[3, 3] = matrix3[8];
return matrix;
}
public static Matrix3 toMatrix3(this Matrix4 matrix4) {
var matrix = Matrix3.I();
matrix[0] = matrix4.entry(0, 0);
matrix[1] = matrix4.entry(0, 1);
matrix[2] = matrix4.entry(0, 3);
matrix[3] = matrix4.entry(1, 0);
matrix[4] = matrix4.entry(1, 1);
matrix[5] = matrix4.entry(1, 3);
matrix[6] = matrix4.entry(3, 0);
matrix[7] = matrix4.entry(3, 1);
matrix[8] = matrix4.entry(3, 3);
return matrix;
}
}
public class TransformProperty : DiagnosticsProperty<Matrix4> {

7
com.unity.uiwidgets/Runtime/painting/shader_warmup.cs


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.ui;
using Canvas = Unity.UIWidgets.ui2.Canvas;
using Paint = Unity.UIWidgets.ui2.Paint;
using PaintingStyle = Unity.UIWidgets.ui2.PaintingStyle;
using Path = Unity.UIWidgets.ui2.Path;
using Picture = Unity.UIWidgets.ui2.Picture;
using PictureRecorder = Unity.UIWidgets.ui2.PictureRecorder;
using Color = Unity.UIWidgets.ui2.Color;
namespace Unity.UIWidgets.painting {
public abstract class ShaderWarmUp {

2
com.unity.uiwidgets/Runtime/painting/strut_style.cs


defaultValue: foundation_.kNullDefaultValue));
string weightDescription = "";
if (fontWeight != null) {
weightDescription = fontWeight.weightValue.ToString();
weightDescription = $"w${fontWeight.index + 1}00";
}
styles.Add(new DiagnosticsProperty<FontWeight>(

241
com.unity.uiwidgets/Runtime/painting/text_painter.cs


using System.Collections.Generic;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;

namespace Unity.UIWidgets.painting {
public class PlaceholderDimensions {
public PlaceholderDimensions(
Size size,
PlaceholderAlignment alignment,
TextBaseline baseline,
float baselineOffset
) {
D.assert(size != null);
D.assert(alignment != null);
this.size = size;
this.alignment = alignment;
this.baseline = baseline;
this.baselineOffset = baselineOffset;
}
public readonly Size size;
public readonly PlaceholderAlignment alignment;
public readonly float baselineOffset;
public readonly TextBaseline baseline;
public override string ToString() {
return $"PlaceholderDimensions({size}, {baseline})";
}
}
public enum TextWidthBasis {
parent,
longestLine,
}
class _CaretMetrics {
public _CaretMetrics(Offset offset, float? fullHeight) {
this.offset = offset;

}
public class TextPainter {
TextSpan _text;
InlineSpan _text;
TextAlign _textAlign;
TextDirection? _textDirection;
float _textScaleFactor;

string _ellipsis;
float _lastMinWidth;
float _lastMaxWidth;
TextWidthBasis _textWidthBasis;
TextHeightBehavior _textHeightBehavior;
public TextPainter(TextSpan text = null,
public TextPainter(InlineSpan text = null,
StrutStyle strutStyle = null) {
StrutStyle strutStyle = null,
TextWidthBasis textWidthBasis = TextWidthBasis.parent,
TextHeightBehavior textHeightBehavior = null) {
D.assert(text == null || text.debugAssertIsValid());
D.assert(maxLines == null || maxLines > 0);
_text = text;
_textAlign = textAlign;
_textDirection = textDirection;

_strutStyle = strutStyle;
_textWidthBasis = textWidthBasis;
_textHeightBehavior = textHeightBehavior;
}
void markNeedsLayout() {
_paragraph = null;
_needsLayout = true;
_previousCaretPosition = null;
_previousCaretPrototype = null;
}
public float textScaleFactor {

}
_textScaleFactor = value;
markNeedsLayout();
_needsLayout = true;
Paragraph.release(ref _paragraph);
}
}

}
_ellipsis = value;
Paragraph.release(ref _paragraph);
_needsLayout = true;
markNeedsLayout();
public TextSpan text {
public InlineSpan text {
if ((_text == null && value == null) || (_text != null && text.Equals(value))) {
D.assert(value == null || value.debugAssertIsValid());
if (_text == value) {
return;
}

_text = value;
Paragraph.release(ref _paragraph);
_needsLayout = true;
markNeedsLayout();
}
}

}
_textDirection = value;
Paragraph.release(ref _paragraph);
markNeedsLayout();
_needsLayout = true;
}
}

}
_textAlign = value;
Paragraph.release(ref _paragraph);
_needsLayout = true;
markNeedsLayout();
}
}

return _paragraph.didExceedMaxLines;
return _paragraph.didExceedMaxLines();
}
}

}
_maxLines = value;
Paragraph.release(ref _paragraph);
_needsLayout = true;
markNeedsLayout();
}
}

}
_strutStyle = value;
_paragraph = null;
_needsLayout = true;
markNeedsLayout();
public TextWidthBasis textWidthBasis {
get { return _textWidthBasis; }
set {
D.assert(value != null);
if (_textWidthBasis == value)
return;
_textWidthBasis = value;
markNeedsLayout();
}
}
public TextHeightBehavior textHeightBehavior {
get { return textHeightBehavior; }
set {
if (_textHeightBehavior == value)
return;
_textHeightBehavior = value;
markNeedsLayout();
}
}
return _applyFloatingPointHack(_paragraph.minIntrinsicWidth);
return _applyFloatingPointHack(_paragraph.minIntrinsicWidth());
}
}

return _applyFloatingPointHack(_paragraph.maxIntrinsicWidth);
return _applyFloatingPointHack(_paragraph.maxIntrinsicWidth());
}
}

return _applyFloatingPointHack(_paragraph.height);
return _applyFloatingPointHack(_paragraph.height());
}
}

return _applyFloatingPointHack(_paragraph.width);
return _applyFloatingPointHack(_paragraph.width());
}
}

case TextBaseline.alphabetic:
return _paragraph.alphabeticBaseline;
return _paragraph.alphabeticBaseline();
return _paragraph.ideographicBaseline;
return _paragraph.ideographicBaseline();
}
return 0.0f;

public void paint(Canvas canvas, Offset offset) {
Debug.Assert(!_needsLayout);
_paragraph.paint(canvas, offset);
canvas.drawParagraph(_paragraph, offset);
}
public Offset getOffsetForCaret(TextPosition position, Rect caretPrototype) {

_caretMetrics = new _CaretMetrics(
offset: rect != null ? new Offset(rect.left, rect.top) : _emptyOffset,
fullHeight: rect != null ? (float?) (rect.bottom - rect.top) : null);
public Paragraph.LineRange getLineRange(int lineNumber) {
public List<TextBox> getBoxesForSelection(TextSelection selection,
ui.BoxHeightStyle boxHeightStyle = ui.BoxHeightStyle.tight,
ui.BoxWidthStyle boxWidthStyle = ui.BoxWidthStyle.tight) {
return _paragraph.getLineRange(lineNumber);
}
public Paragraph.LineRange getLineRange(TextPosition textPosition) {
return getLineRange(getLineIndex(textPosition));
}
public List<TextBox> getBoxesForSelection(TextSelection selection) {
D.assert(!_needsLayout);
var results = _paragraph.getRectsForRange(selection.start, selection.end);
var results = _paragraph.getBoxesForRange(selection.start, selection.end, boxHeightStyle: boxHeightStyle,
boxWidthStyle: boxWidthStyle);
var result = _paragraph.getGlyphPositionAtCoordinate(offset.dx, offset.dy);
return new TextPosition(result.position, result.affinity);
return _paragraph.getPositionForOffset(offset);
var range = _paragraph.getWordBoundary(position.offset);
return new TextRange(range.start, range.end);
}
public TextPosition getPositionVerticalMove(TextPosition position, int move) {
D.assert(!_needsLayout);
var offset = getOffsetForCaret(position, Rect.zero);
var lineIndex = Mathf.Min(Mathf.Max(_paragraph.getLine(position) + move, 0),
_paragraph.getLineCount() - 1);
var targetLineStart = _paragraph.getLineRange(lineIndex).start;
var newLineOffset = getOffsetForCaret(new TextPosition(targetLineStart), Rect.zero);
return getPositionForOffset(new Offset(offset.dx, newLineOffset.dy));
}
public int getLineIndex(TextPosition position) {
D.assert(!_needsLayout);
return _paragraph.getLine(position);
}
public int getLineCount() {
D.assert(!_needsLayout);
return _paragraph.getLineCount();
}
public TextPosition getWordRight(TextPosition position) {
D.assert(!_needsLayout);
var offset = position.offset;
while (true) {
var range = _paragraph.getWordBoundary(offset);
if (range.end == range.start) {
break;
}
if (!char.IsWhiteSpace((char) (text.codeUnitAt(range.start) ?? 0))) {
return new TextPosition(range.end);
}
offset = range.end;
}
return new TextPosition(offset, position.affinity);
return _paragraph.getWordBoundary(position);
public TextPosition getWordLeft(TextPosition position) {
TextRange getLineBoundary(TextPosition position) {
var offset = Mathf.Max(position.offset - 1, 0);
while (true) {
var range = _paragraph.getWordBoundary(offset);
if (!char.IsWhiteSpace((char) (text.codeUnitAt(range.start) ?? 0))) {
return new TextPosition(range.start);
}
offset = Mathf.Max(range.start - 1, 0);
if (offset == 0) {
break;
}
}
return new TextPosition(offset, position.affinity);
return _paragraph.getLineBoundary(position);
if (_text.style == null) {
return new ParagraphStyle(
textAlign: textAlign,
textDirection: textDirection ?? defaultTextDirection,
maxLines: maxLines,
ellipsis: ellipsis,
strutStyle: _strutStyle
);
}
return _text.style.getParagraphStyle(textAlign, textDirection ?? defaultTextDirection,
ellipsis, maxLines, textScaleFactor);
D.assert(textAlign != null);
D.assert(textDirection != null, () => "TextPainter.textDirection must be set to a non-null value before using the TextPainter.");
return _text.style?.getParagraphStyle(
textAlign: textAlign,
textDirection: textDirection ?? defaultTextDirection,
textScaleFactor: textScaleFactor,
maxLines: _maxLines,
// textHeightBehavior: _textHeightBehavior,
ellipsis: _ellipsis
// locale: _locale,
// strutStyle: _strutStyle,
) ?? new ui.ParagraphStyle(
textAlign: textAlign,
textDirection: textDirection ?? defaultTextDirection,
maxLines: maxLines,
textHeightBehavior: _textHeightBehavior,
ellipsis: ellipsis
// locale: locale,
);
}
public float preferredLineHeight {

); // direction doesn't matter, text is just a space
if (text != null && text.style != null) {
builder.pushStyle(text.style, textScaleFactor);
builder.pushStyle(text.style.getTextStyle(textScaleFactor: textScaleFactor));
}
builder.addText(" ");

return _layoutTemplate.height;
return _layoutTemplate.height();
}
}

List<TextBox> boxes = null;
while ((boxes == null || boxes.isEmpty()) && flattenedText != null) {
int prevRuneOffset = offset - graphemeClusterLength;
boxes = _paragraph.getRectsForRange(prevRuneOffset, offset);
boxes = _paragraph.getBoxesForRange(prevRuneOffset, offset);
if (boxes.isEmpty()) {
if (!needsSearch) {
break;

List<TextBox> boxes = null;
while ((boxes == null || boxes.isEmpty()) && flattenedText != null) {
int nextRuneOffset = offset + graphemeClusterLength;
boxes = _paragraph.getRectsForRange(offset, nextRuneOffset);
boxes = _paragraph.getBoxesForRange(offset, nextRuneOffset);
if (boxes.isEmpty()) {
if (!needsSearch) {
break;

190
com.unity.uiwidgets/Runtime/painting/text_span.cs


using UnityEngine.Assertions;
namespace Unity.UIWidgets.painting {
public class TextSpan : DiagnosticableTree, IEquatable<TextSpan> {
public class TextSpan : InlineSpan, IEquatable<TextSpan> {
public List<string> splitedText;
public readonly string semanticsLabel;
public TextSpan(string text = "", TextStyle style = null, List<TextSpan> children = null,
GestureRecognizer recognizer = null, HoverRecognizer hoverRecognizer = null) {
public TextSpan(
string text = "",
TextStyle style = null,
List<TextSpan> children = null,
GestureRecognizer recognizer = null,
HoverRecognizer hoverRecognizer = null,
string semanticsLabel = null) : base(style) {
splitedText = !string.IsNullOrEmpty(text) ? EmojiUtils.splitByEmoji(text) : null;
this.semanticsLabel = semanticsLabel;
public void build(ParagraphBuilder builder, float textScaleFactor = 1.0f) {
var hasStyle = this.style != null;
public override void build(ParagraphBuilder builder, float textScaleFactor = 1.0f,
List<PlaceholderDimensions> dimensions = null) {
D.assert(debugAssertIsValid());
var hasStyle = style != null;
builder.pushStyle(style, textScaleFactor);
builder.pushStyle(style.getTextStyle(textScaleFactor: textScaleFactor));
if (splitedText != null) {
if (splitedText.Count == 1 && !char.IsHighSurrogate(splitedText[0][0]) &&
!EmojiUtils.isSingleCharEmoji(splitedText[0][0])) {
builder.addText(splitedText[0]);
if (text != null)
builder.addText(text);
if (children != null) {
foreach (InlineSpan child in children) {
D.assert(child != null);
child.build(
builder,
textScaleFactor: textScaleFactor,
dimensions: dimensions
);
else {
TextStyle style = this.style ?? new TextStyle();
for (int i = 0; i < splitedText.Count; i++) {
builder.pushStyle(style, textScaleFactor);
builder.addText(splitedText[i]);
builder.pop();
}
}
if (hasStyle) {
builder.pop();
}
}
public override bool visitChildren(InlineSpanVisitor visitor) {
if (text != null) {
if (!visitor(this))
return false;
}
if (children != null) {
foreach (InlineSpan child in children) {
if (!child.visitChildren(visitor))
return false;
return true;
}
protected override InlineSpan getSpanForPositionVisitor(TextPosition position, Accumulator offset) {
if (text == null) {
return null;
}
TextAffinity affinity = position.affinity;
int targetOffset = position.offset;
int endOffset = offset.value + text.Length;
if (offset.value == targetOffset && affinity == TextAffinity.downstream ||
offset.value < targetOffset && targetOffset < endOffset ||
endOffset == targetOffset && affinity == TextAffinity.upstream) {
return this;
}
offset.increment(text.Length);
return null;
}
public override void computeToPlainText(StringBuilder buffer, bool includeSemanticsLabels = true,
bool includePlaceholders = true) {
D.assert(debugAssertIsValid());
if (semanticsLabel != null && includeSemanticsLabels) {
buffer.Append(semanticsLabel);
}
else if (text != null) {
buffer.Append(text);
}
foreach (var child in children) {
Assert.IsNotNull(child);
child.build(builder, textScaleFactor);
foreach (InlineSpan child in children) {
child.computeToPlainText(buffer,
includeSemanticsLabels: includeSemanticsLabels,
includePlaceholders: includePlaceholders
);
}
if (hasStyle) {
builder.pop();
public override void computeSemanticsInformation(List<InlineSpanSemanticsInformation> collector) {
D.assert(debugAssertIsValid());
if (text != null || semanticsLabel != null) {
collector.Add(new InlineSpanSemanticsInformation(
text,
semanticsLabel: semanticsLabel,
recognizer: recognizer
));
}
if (children != null) {
foreach (InlineSpan child in children) {
child.computeSemanticsInformation(collector);
}
protected override int? codeUnitAtVisitor(int index, Accumulator offset) {
if (text == null) {
return null;
}
if (index - offset.value < text.Length) {
return text[index - offset.value];
}
offset.increment(text.Length);
return null;
}
public bool hasHoverRecognizer {
get {
bool need = false;

return result;
}
public string toPlainText() {
var sb = new StringBuilder();
visitTextSpan((span) => {
sb.Append(span.text);
return true;
});
return sb.ToString();
}
public int? codeUnitAt(int index) {
if (index < 0) {
return null;

return true;
}
public RenderComparison compareTo(TextSpan other) {
if (Equals(other)) {
public override RenderComparison compareTo(InlineSpan other) {
if (Equals(this, other))
}
if (other.text != text
|| ((children == null) != (other.children == null))
|| (children != null && other.children != null && children.Count != other.children.Count)
|| ((style == null) != (other.style != null))
) {
if (other.GetType()!= GetType())
}
RenderComparison result = Equals(recognizer, other.recognizer)
? RenderComparison.identical
: RenderComparison.metadata;
if (!Equals(hoverRecognizer, other.hoverRecognizer)) {
result = RenderComparison.function > result ? RenderComparison.function : result;
}
TextSpan textSpan = other as TextSpan;
if (textSpan.text != text ||
children?.Count != textSpan.children?.Count ||
(style == null) != (textSpan.style == null))
return RenderComparison.layout;
RenderComparison result = recognizer == textSpan.recognizer ?
RenderComparison.identical :
RenderComparison.metadata;
var candidate = style.compareTo(other.style);
if (candidate > result) {
RenderComparison candidate = style.compareTo(textSpan.style);
if (candidate > result)
}
if (result == RenderComparison.layout) {
if (result == RenderComparison.layout)
}
for (var index = 0; index < children.Count; index++) {
var candidate = children[index].compareTo(other.children[index]);
if (candidate > result) {
for (int index = 0; index < children.Count; index += 1) {
RenderComparison candidate = children[index].compareTo(textSpan.children[index]);
if (candidate > result)
}
if (result == RenderComparison.layout) {
if (result == RenderComparison.layout)
}
return result;
}

40
com.unity.uiwidgets/Runtime/painting/text_style.cs


public ParagraphStyle getParagraphStyle(TextAlign textAlign,
TextDirection textDirection, string ellipsis, int? maxLines, float textScaleFactor = 1.0f) {
return new ParagraphStyle(
textAlign, textDirection, fontWeight, fontStyle,
maxLines, (fontSize ?? _defaultFontSize) * textScaleFactor, fontFamily, height,
ellipsis
textAlign: textAlign, textDirection: textDirection, fontWeight: fontWeight, fontStyle: fontStyle,
maxLines: maxLines, fontSize: (fontSize ?? _defaultFontSize) * textScaleFactor, fontFamily: fontFamily,
height: height,
ellipsis: ellipsis
);
}

);
}
public ui.TextStyle getTextStyle(float textScaleFactor = 1.0f ) {
var backgroundPaint = new Paint();
if (background != null) {
backgroundPaint = new Paint();
backgroundPaint.color = backgroundColor;
}
return new ui.TextStyle(
color: color,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
fontWeight: fontWeight,
fontStyle: fontStyle,
textBaseline: textBaseline,
fontFamily: fontFamily,
fontFamilyFallback: fontFamilyFallback,
fontSize: fontSize == null ? null : fontSize * textScaleFactor,
letterSpacing: letterSpacing,
wordSpacing: wordSpacing,
height: height,
// locale: locale,
foreground: foreground,
background: background ?? (backgroundColor != null
? backgroundPaint : null
),
shadows: shadows?.Cast<Shadow>().ToList()
// fontFeatures: fontFeatures,
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);

defaultValue: foundation_.kNullDefaultValue));
string weightDescription = "";
if (fontWeight != null) {
weightDescription = fontWeight.weightValue.ToString();
weightDescription = $"{fontWeight.index + 1}00";
}
styles.Add(new DiagnosticsProperty<FontWeight>(

2
com.unity.uiwidgets/Runtime/rendering/animated_size.cs


using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.rendering {

2
com.unity.uiwidgets/Runtime/rendering/box.cs


D.assert(() => {
if (_debugActivePointers > 0) {
var paint = new Paint {
color = new Color(0x00BBBB | ((0x04000000 * depth) & 0xFF000000)),
color = new Color((uint)(0x00BBBB | ((0x04000000 * depth) & 0xFF000000))),
};
context.canvas.drawRect(offset & size, paint);
}

6
com.unity.uiwidgets/Runtime/rendering/debug_overflow_indicator.cs


);
_labelBackgroundPaint.color = new Color(0xFFFFFFFF);
for (int i = 0; i < 4; i++) {
_indicatorLabel.Add(new TextPainter(new TextSpan(""), textDirection: TextDirection.ltr));
_indicatorLabel.Add(new TextPainter(textDirection: TextDirection.ltr));
}
}

List<_OverflowRegionData> overflowRegions = _calculateOverflowRegions(overflow, containerRect);
foreach (_OverflowRegionData region in overflowRegions) {
context.canvas.drawRect(region.rect.shift(offset), _indicatorPaint);
TextSpan textSpan = _indicatorLabel[(int) region.side].text as TextSpan;
if (_indicatorLabel[(int) region.side].text?.text != region.label) {
if (textSpan?.text != region.label) {
_indicatorLabel[(int) region.side].text = new TextSpan(
text: region.label,
style: _indicatorTextStyle

122
com.unity.uiwidgets/Runtime/rendering/editable.cs


using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
namespace Unity.UIWidgets.rendering {
class EditableUtils {

break;
case KeyCommand.Paste:
TextEditingValue value = textSelectionDelegate.textEditingValue;
Clipboard.getData(Clipboard.kTextPlain).Then(data => {
Clipboard.getData(Clipboard.kTextPlain).then_(data => {
if (data != null) {
textSelectionDelegate.textEditingValue = new TextEditingValue(
text: value.selection.textBefore(value.text)

TextPainter _textPainter;
public TextSpan text {
get { return _textPainter.text; }
get { return _textPainter.text as TextSpan; }
set {
if (_textPainter.text == value) {
return;

return rect.shift(_getPixelPerfectCursorOffset(rect));
}
public TextPosition getPositionDown(TextPosition position) {
return _textPainter.getPositionVerticalMove(position, 1);
}
public TextPosition getPositionUp(TextPosition position) {
return _textPainter.getPositionVerticalMove(position, -1);
}
public TextPosition getLineStartPosition(TextPosition position, TextAffinity? affinity = null) {
var line = _textPainter.getLineRange(position);
return new TextPosition(offset: line.start, affinity: affinity ?? position.affinity);
}
public bool isLineEndOrStart(int offset) {
int lineCount = _textPainter.getLineCount();
for (int i = 0; i < lineCount; i++) {
var line = _textPainter.getLineRange(i);
if (line.start == offset || line.endIncludingNewLine == offset) {
return true;
}
}
return false;
}
public TextPosition getLineEndPosition(TextPosition position, TextAffinity? affinity = null) {
var line = _textPainter.getLineRange(position);
return new TextPosition(offset: line.endIncludingNewLine, affinity: affinity ?? position.affinity);
}
public TextPosition getWordRight(TextPosition position) {
return _textPainter.getWordRight(position);
}
public TextPosition getWordLeft(TextPosition position) {
return _textPainter.getWordLeft(position);
}
public TextPosition getParagraphStart(TextPosition position, TextAffinity? affinity = null) {
D.assert(!_needsLayout);
int lineIndex = _textPainter.getLineIndex(position);
while (lineIndex - 1 >= 0) {
var preLine = _textPainter.getLineRange(lineIndex - 1);
if (preLine.hardBreak) {
break;
}
lineIndex--;
}
var line = _textPainter.getLineRange(lineIndex);
return new TextPosition(offset: line.start, affinity: affinity ?? position.affinity);
}
public TextPosition getParagraphEnd(TextPosition position, TextAffinity? affinity = null) {
D.assert(!_needsLayout);
int lineIndex = _textPainter.getLineIndex(position);
int maxLine = _textPainter.getLineCount();
while (lineIndex < maxLine) {
var line = _textPainter.getLineRange(lineIndex);
if (line.hardBreak) {
break;
}
lineIndex++;
}
return new TextPosition(offset: _textPainter.getLineRange(lineIndex).endIncludingNewLine,
affinity: affinity ?? position.affinity);
}
public TextPosition getParagraphForward(TextPosition position, TextAffinity? affinity = null) {
var lineCount = _textPainter.getLineCount();
Paragraph.LineRange? line = null;
for (int i = 0; i < lineCount; ++i) {
line = _textPainter.getLineRange(i);
if (!line.Value.hardBreak) {
continue;
}
if (line.Value.end > position.offset) {
break;
}
}
if (line == null) {
return new TextPosition(position.offset, affinity ?? position.affinity);
}
return new TextPosition(line.Value.end, affinity ?? position.affinity);
}
public TextPosition getParagraphBackward(TextPosition position, TextAffinity? affinity = null) {
var lineCount = _textPainter.getLineCount();
Paragraph.LineRange? line = null;
for (int i = lineCount - 1; i >= 0; --i) {
line = _textPainter.getLineRange(i);
if (i != 0 && !_textPainter.getLineRange(i - 1).hardBreak) {
continue;
}
if (line.Value.start < position.offset) {
break;
}
}
if (line == null) {
return new TextPosition(position.offset, affinity ?? position.affinity);
}
return new TextPosition(line.Value.start, affinity ?? position.affinity);
}
protected override float computeMinIntrinsicWidth(float height) {
_layoutText(float.PositiveInfinity);
return _textPainter.minIntrinsicWidth;

}
if (!width.isFinite()) {
var text = _textPainter.text.text;
var text = _textPainter.text.toPlainText();
int lines = 1;
for (int index = 0; index < text.Length; ++index) {
if (text[index] == 0x0A) {

18
com.unity.uiwidgets/Runtime/rendering/image.cs


ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool invertColors = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) {
_image = image;
_width = width;

_centerSlice = centerSlice;
_alignment = alignment ?? Alignment.center;
_invertColors = invertColors;
_filterMode = filterMode;
_filterQuality = filterQuality;
_updateColorFilter();
}

}
}
FilterMode _filterMode;
FilterQuality _filterQuality;
public FilterMode filterMode {
get { return _filterMode; }
public FilterQuality filterQuality {
get { return _filterQuality; }
if (value == _filterMode) {
if (value == _filterQuality) {
_filterMode = value;
_filterQuality = value;
markNeedsPaint();
}
}

centerSlice: _centerSlice,
repeat: _repeat,
invertColors: _invertColors,
filterMode: _filterMode
filterQuality: _filterQuality
);
}

properties.add(new DiagnosticsProperty<Rect>("centerSlice", centerSlice,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new DiagnosticsProperty<bool>("invertColors", invertColors));
properties.add(new EnumProperty<FilterMode>("filterMode", filterMode));
properties.add(new EnumProperty<FilterQuality>("filterMode", filterQuality));
}
}
}

216
com.unity.uiwidgets/Runtime/rendering/layer.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;

get { return (ContainerLayer) base.parent; }
}
bool _needsAddToScene = true;
public bool _needsAddToScene = true;
if (_needsAddToScene) {
return;
}
_needsAddToScene = true;
}

internal bool _subtreeNeedsAddToScene;
flow.Layer _engineLayer;
protected EngineLayer engineLayer {
get { return _engineLayer; }
set {
_engineLayer = value;
if (!alwaysNeedsAddToScene) {
if (parent != null && !parent.alwaysNeedsAddToScene) {
parent.markNeedsAddToScene();
}
}
}
}
EngineLayer _engineLayer;
_subtreeNeedsAddToScene = _needsAddToScene || alwaysNeedsAddToScene;
_needsAddToScene = _needsAddToScene || alwaysNeedsAddToScene;
}
public Layer nextSibling {

internal Layer _previousSibling;
protected override void dropChild(AbstractNodeMixinDiagnosticableTree child) {
markNeedsAddToScene();
if (!alwaysNeedsAddToScene) {
markNeedsAddToScene();
}
markNeedsAddToScene();
if (!alwaysNeedsAddToScene) {
markNeedsAddToScene();
}
base.adoptChild(child);
}

internal abstract S find<S>(Offset regionOffset) where S : class;
internal abstract flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null);
internal abstract void addToScene(SceneBuilder builder, Offset layerOffset = null);
if (!_subtreeNeedsAddToScene && _engineLayer != null) {
if (!_needsAddToScene && _engineLayer != null) {
_engineLayer = addToScene(builder);
addToScene(builder);
_needsAddToScene = false;
}

return null;
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
return null;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

public class TextureLayer : Layer {
public TextureLayer(
Rect rect,
Texture texture,
int textureId,
D.assert(texture != null);
this.texture = texture;
this.textureId = textureId;
public readonly Texture texture;
public readonly int textureId;
public readonly bool freeze;

internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
texture,
textureId,
return null;
}
}

PictureLayer _highlightConflictingLayer(PhysicalModelLayer child) {
PictureRecorder recorder = new PictureRecorder();
var canvas = new RecorderCanvas(recorder);
var canvas = new Canvas(recorder);
canvas.drawPath(child.clipPath, new Paint() {
color = new Color(0xFFAA0000),
style = PaintingStyle.stroke,

Layer child = firstChild;
while (child != null) {
child.updateSubtreeNeedsAddToScene();
_subtreeNeedsAddToScene = _subtreeNeedsAddToScene || child._subtreeNeedsAddToScene;
_needsAddToScene = _needsAddToScene || child._needsAddToScene;
child = child.nextSibling;
}
}

_lastChild = null;
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
return null;
}
public void addChildrenToScene(SceneBuilder builder, Offset childOffset = null) {

return scene;
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
var engineLayer = builder.pushOffset(
engineLayer = builder.pushOffset(
(float) (layerOffset.dy + offset.dy));
(float) (layerOffset.dy + offset.dy),
oldLayer: engineLayer as OffsetEngineLayer);
return engineLayer;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

return base.find<S>(regionOffset);
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
bool enabled = true;

});
if (enabled) {
builder.pushClipRect(clipRect.shift(layerOffset));
var shiftedClipRect = layerOffset == Offset.zero ? clipRect : clipRect.shift(layerOffset);
engineLayer = builder.pushClipRect(
rect: shiftedClipRect,
clipBehavior: clipBehavior,
oldLayer: engineLayer as ClipRectEngineLayer);
}
else {
engineLayer = null;
}
addChildrenToScene(builder, layerOffset);

}
return null;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

return base.find<S>(regionOffset);
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
bool enabled = true;

});
if (enabled) {
builder.pushClipRRect(clipRRect.shift(layerOffset));
var shiftedClipRRect = layerOffset == Offset.zero ? clipRRect : clipRRect.shift(layerOffset);
engineLayer = builder.pushClipRRect(
shiftedClipRRect,
clipBehavior: clipBehavior,
oldLayer: engineLayer as ClipRRectEngineLayer
);
}
else {
engineLayer = null;
}
addChildrenToScene(builder, layerOffset);

}
return null;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

return base.find<S>(regionOffset);
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
bool enabled = true;

});
if (enabled) {
builder.pushClipPath(clipPath.shift(layerOffset));
var shiftedPath = layerOffset == Offset.zero ? clipPath : clipPath.shift(layerOffset);
engineLayer = builder.pushClipPath(
shiftedPath,
clipBehavior: clipBehavior,
oldLayer: engineLayer as ClipPathEngineLayer);
}
else {
engineLayer = null;
}
addChildrenToScene(builder, layerOffset);

}
return null;
}
}

return base.find<S>(new Offset(result[0], result[1]));
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
_lastEffectiveTransform = _transform;

_lastEffectiveTransform.multiply(transform);
}
builder.pushTransform(_lastEffectiveTransform.toMatrix3());
engineLayer = builder.pushTransform(
_lastEffectiveTransform._m4storage,
oldLayer: engineLayer as TransformEngineLayer);
return null;
}
public override void applyTransform(Layer child, Matrix4 transform) {

}
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
bool enabled = true;

});
builder.pushOpacity(alpha, offset: offset + layerOffset);
engineLayer = builder.pushOpacity(
alpha,
offset: offset + layerOffset,
oldLayer: engineLayer as OpacityEngineLayer);
}
else {
engineLayer = null;
}
addChildrenToScene(builder, layerOffset);

return null;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

}
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
builder.pushBackdropFilter(filter);
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
D.assert(filter != null);
engineLayer = builder.pushBackdropFilter(
filter: filter,
oldLayer: engineLayer as BackdropFilterEngineLayer);
return null;
}
}

return base.find<S>(regionOffset - offset);
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
builder.pushTransform(new Matrix4()
engineLayer = builder.pushTransform(
new Matrix4()
.toMatrix3());
._m4storage,
oldLayer: engineLayer as TransformEngineLayer);
}
addChildrenToScene(builder, Offset.zero);

return null;
}
public override void applyTransform(Layer child, Matrix4 transform) {

}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
D.assert(link != null);

_inverseDirty = true;
return null;
engineLayer = null;
builder.pushTransform(_lastTransform.toMatrix3());
engineLayer = builder.pushTransform(
_lastTransform._m4storage,
oldLayer: engineLayer as TransformEngineLayer);
addChildrenToScene(builder);
builder.pop();
_lastOffset = unlinkedOffset + layerOffset;

var matrix = new Matrix4().translationValues(unlinkedOffset.dx, unlinkedOffset.dy, 0);
builder.pushTransform(matrix.toMatrix3());
engineLayer = builder.pushTransform(
matrix._m4storage,
oldLayer: engineLayer as TransformEngineLayer);
return null;
}
public override void applyTransform(Layer child, Matrix4 transform) {

return null;
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
layerOffset = layerOffset ?? Offset.zero;
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
D.assert(optionsMask != null);
builder.addPerformanceOverlay(optionsMask, overlayRect.shift(layerOffset));
return null;
layerOffset = layerOffset ?? Offset.zero;
var shiftedOverlayRect = layerOffset == Offset.zero ? overlayRect : overlayRect.shift(layerOffset);
builder.addPerformanceOverlay(optionsMask, shiftedOverlayRect);
//TODO: add implementations
//builder.setRasterizerTracingThreshold(rasterizerThreshold);
//builder.setCheckerboardRasterCacheImages(checkerboardRasterCacheImages);
//builder.setCheckerboardOffscreenLayers(checkerboardOffscreenLayers);
}
}

ancestor = ancestor.parent;
}
return clipPath.transform(matrix.toMatrix3());
return clipPath.transform(matrix._m4storage);
}
}

return base.find<S>(regionOffset);
}
internal override flow.Layer addToScene(SceneBuilder builder, Offset layerOffset = null) {
internal override void addToScene(SceneBuilder builder, Offset layerOffset = null) {
D.assert(clipPath != null);
D.assert(color != null);
D.assert(shadowColor != null);
builder.pushPhysicalShape(
path: clipPath.shift(layerOffset),
elevation: elevation,
color: color,
shadowColor: shadowColor,
clipBehavior: clipBehavior);
bool enabled = true;
D.assert(() => {
enabled = !D.debugDisablePhysicalShapeLayers;
return true;
});
if (enabled) {
engineLayer = builder.pushPhysicalShape(
path: layerOffset == Offset.zero ? clipPath : clipPath.shift(layerOffset),
elevation: elevation,
color: color,
shadowColor: shadowColor,
clipBehavior: clipBehavior,
oldLayer: engineLayer as PhysicalShapeEngineLayer);
}
else {
engineLayer = null;
}
builder.pop();
return null;
if (enabled) {
builder.pop();
}
}

4
com.unity.uiwidgets/Runtime/rendering/object.cs


_currentLayer = new PictureLayer(estimatedBounds);
_recorder = new PictureRecorder();
_canvas = new RecorderCanvas(_recorder);
_canvas = new Canvas(_recorder);
_containerLayer.append(_currentLayer);
}

}
else {
canvas.save();
canvas.concat(effectiveTransform.toMatrix3());
canvas.transform(effectiveTransform._m4storage);
painter(this, offset);
canvas.restore();
}

19
com.unity.uiwidgets/Runtime/rendering/paragraph.cs


using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
namespace Unity.UIWidgets.rendering {
public enum TextOverflow {

}
}
public TextSpan text {
public InlineSpan text {
get { return _textPainter.text; }
set {

}
}
TextSpan _previousHoverSpan;
InlineSpan _previousHoverSpan;
#pragma warning disable 0414
bool _pointerHoverInside;

void _resetHoverHandler() {
_hasHoverRecognizer = _textPainter.text.hasHoverRecognizer;
_hasHoverRecognizer = (_textPainter.text as TextSpan)?.hasHoverRecognizer ?? false;
_previousHoverSpan = null;
_pointerHoverInside = false;

void _onPointerExit(PointerEvent evt) {
_pointerHoverInside = false;
_previousHoverSpan?.hoverRecognizer?.OnPointerLeave?.Invoke();
(_previousHoverSpan as TextSpan)?.hoverRecognizer?.OnPointerLeave?.Invoke();
_previousHoverSpan = null;
}

TextPosition position = _textPainter.getPositionForOffset(offset);
TextSpan span = _textPainter.text.getSpanForPosition(position);
InlineSpan span = _textPainter.text.getSpanForPosition(position);
_previousHoverSpan?.hoverRecognizer?.OnPointerLeave?.Invoke();
span?.hoverRecognizer?.OnPointerEnter?.Invoke((PointerHoverEvent) evt);
(_previousHoverSpan as TextSpan)?.hoverRecognizer?.OnPointerLeave?.Invoke();
(span as TextSpan)?.hoverRecognizer?.OnPointerEnter?.Invoke((PointerHoverEvent) evt);
_previousHoverSpan = span;
}
}

_layoutTextWithConstraints(constraints);
Offset offset = ((BoxHitTestEntry) entry).localPosition;
TextPosition position = _textPainter.getPositionForOffset(offset);
TextSpan span = _textPainter.text.getSpanForPosition(position);
span?.recognizer?.addPointer((PointerDownEvent) evt);
InlineSpan span = _textPainter.text.getSpanForPosition(position);
(span as TextSpan)?.recognizer?.addPointer((PointerDownEvent) evt);
}
protected override void performLayout() {

8
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


D.assert(() => {
if (child != null) {
base.debugPaintSize(context, offset);
Path offsetPath = new Path();
offsetPath.addPath(_clip, offset);
context.canvas.drawPath(offsetPath, _debugPaint);
context.canvas.drawPath(_clip.shift(offset), _debugPaint);
_debugText.paint(context.canvas, offset);
}

if (child != null) {
_updateClip();
Rect offsetBounds = offset & size;
Path offsetPath = new Path();
offsetPath.addPath(_clip, offset);
Path offsetPath = _clip.shift(offset);
PhysicalModelLayer physicalModel = new PhysicalModelLayer(
clipPath: offsetPath,

shadowColor: shadowColor);
context.pushLayer(physicalModel, base.paint, offset, childPaintBounds: offsetBounds);
}
}

2
com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;

20
com.unity.uiwidgets/Runtime/rendering/texture.cs


namespace Unity.UIWidgets.rendering {
public class TextureBox : RenderBox {
public TextureBox(Texture texture = null) {
D.assert(texture != null);
_texture = texture;
public TextureBox(int textureId) {
D.assert(textureId != null);
_textureId = textureId;
public Texture texture {
get { return _texture; }
public int? textureId {
get { return _textureId; }
if (value != _texture) {
_texture = value;
if (value != _textureId) {
_textureId = value;
Texture _texture;
int? _textureId;
protected override bool sizedByParent {
get { return true; }

}
public override void paint(PaintingContext context, Offset offset) {
if (_texture == null) {
if (_textureId == null) {
texture: _texture
textureId: _textureId.Value
));
}
}

4
com.unity.uiwidgets/Runtime/rendering/view.cs


public readonly float devicePixelRatio;
public Matrix4 toMatrix() {
// return new Matrix4().diagonal3Values(this.devicePixelRatio, this.devicePixelRatio, 0);
return new Matrix4().identity();
return new Matrix4().diagonal3Values(this.devicePixelRatio, this.devicePixelRatio, 0);
//return new Matrix4().identity();
}
public override string ToString() {

12
com.unity.uiwidgets/Runtime/rendering/viewport_offset.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
namespace Unity.UIWidgets.rendering {

public abstract void correctBy(float correction);
public abstract void jumpTo(float pixels);
public abstract IPromise animateTo(float to, TimeSpan duration, Curve curve);
public abstract Future animateTo(float to, TimeSpan duration, Curve curve);
public virtual IPromise moveTo(float to, TimeSpan? duration, Curve curve = null, bool clamp = true) {
public virtual Future moveTo(float to, TimeSpan? duration, Curve curve = null, bool clamp = true) {
return Promise.Resolved();
return Future.value();
} else {
return animateTo(to, duration: duration??TimeSpan.Zero , curve: curve ?? Curves.ease);
}

public override void jumpTo(float pixels) {
}
public override IPromise animateTo(float to, TimeSpan duration, Curve curve) {
return Promise.Resolved();
public override Future animateTo(float to, TimeSpan duration, Curve curve) {
return Future.value();
}
public override ScrollDirection userScrollDirection {

5
com.unity.uiwidgets/Runtime/scheduler/binding.cs


using System;
/*
using System;
using System.Collections.Generic;
using System.Text;
using RSG.Promises;

});
}
}
}
}*/

3
com.unity.uiwidgets/Runtime/scheduler/ticker.cs


/*
using System;
using System.Text;
using RSG;

return "The ticker was canceled before the \"orCancel\" property was first used.";
}
}
}
}*/

4
com.unity.uiwidgets/Runtime/scheduler2/binding.cs


using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
using FrameTiming = Unity.UIWidgets.ui2.FrameTiming;
using FrameTiming = Unity.UIWidgets.ui.FrameTiming;
using Timer = Unity.UIWidgets.async2.Timer;
namespace Unity.UIWidgets.scheduler2 {

18
com.unity.uiwidgets/Runtime/service/clipboard.cs


using System.Runtime.InteropServices;
using RSG;
using Unity.UIWidgets.async2;
using UnityEngine;
namespace Unity.UIWidgets.service {

public static readonly string kTextPlain = "text/plain";
public static IPromise setData(ClipboardData data) {
public static Future setData(ClipboardData data) {
public static IPromise<ClipboardData> getData(string format) {
public static Future<ClipboardData> getData(string format) {
protected abstract IPromise setClipboardData(ClipboardData data);
protected abstract IPromise<ClipboardData> getClipboardData(string format);
protected abstract Future setClipboardData(ClipboardData data);
protected abstract Future<ClipboardData> getClipboardData(string format);
protected override IPromise setClipboardData(ClipboardData data) {
protected override Future setClipboardData(ClipboardData data) {
#if UNITY_WEBGL
UIWidgetsCopyTextToClipboard(data.text);
#else

return Promise.Resolved();
return Future.value();
protected override IPromise<ClipboardData> getClipboardData(string format) {
protected override Future<ClipboardData> getClipboardData(string format) {
return Promise<ClipboardData>.Resolved(data);
return Future.value(FutureOr.value(data)).to<ClipboardData>();
}
#if UNITY_WEBGL

9
com.unity.uiwidgets/Runtime/service/keyboard.cs


using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

}
public void setIMEPos(Offset imeGlobalPos) {
var uiWidgetWindowAdapter = Window.instance as UIWidgetWindowAdapter;
var uiWidgetWindowAdapter = Window.instance;
Offset screenPos = uiWidgetWindowAdapter != null
? uiWidgetWindowAdapter.windowPosToScreenPos(imeGlobalPos)
: _editorWindowPosToScreenPos(imeGlobalPos);

}
void _handleMethodCall(string method, List<JSONNode> args) {
if (TextInput._currentConnection == null) {
D.assert(false, () => "keyboard.handleMethodCall is not implemented yet!");
/*if (TextInput._currentConnection == null) {
return;
}
int client = args[0].AsInt;

default:
throw new UIWidgetsError($"unknown method ${method}");
}
}
}*/
}
}

182
com.unity.uiwidgets/Runtime/service/text_editing.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.service {
public class TextRange : IEquatable<TextRange> {
public readonly int start;
public readonly int end;
public static TextRange collapsed(int offset) {
D.assert(offset >= -1);
return new TextRange(offset, offset);
}
public static readonly TextRange empty = new TextRange(-1, -1);
public TextRange(int start, int end) {
D.assert(start >= -1);
D.assert(end >= -1);
this.start = start;
this.end = end;
}
public bool isValid {
get { return start >= 0 && end >= 0; }
}
public bool isCollapsed {
get { return start == end; }
}
public bool isNormalized {
get { return start <= end; }
}
public string textBefore(string text) {
D.assert(isNormalized);
return text.Substring(0, start);
}
public string textAfter(string text) {
D.assert(isNormalized);
return text.Substring(end);
}
public string textInside(string text) {
D.assert(isNormalized);
return text.Substring(start, end - start);
}
public bool Equals(TextRange other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return start == other.start && end == other.end;
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != GetType()) {
return false;
}
return Equals((TextRange) obj);
}
public override int GetHashCode() {
unchecked {
return (start * 397) ^ end;
}
}
public static bool operator ==(TextRange left, TextRange right) {
return Equals(left, right);
}
public static bool operator !=(TextRange left, TextRange right) {
return !Equals(left, right);
}
public override string ToString() {
return $"TextRange Start: {start}, End: {end}";
}
}
// public class TextRange : IEquatable<TextRange> {
// public readonly int start;
// public readonly int end;
//
// public static TextRange collapsed(int offset) {
// D.assert(offset >= -1);
// return new TextRange(offset, offset);
// }
//
// public static readonly TextRange empty = new TextRange(-1, -1);
//
// public TextRange(int start, int end) {
// D.assert(start >= -1);
// D.assert(end >= -1);
// this.start = start;
// this.end = end;
// }
//
// public bool isValid {
// get { return start >= 0 && end >= 0; }
// }
//
// public bool isCollapsed {
// get { return start == end; }
// }
//
// public bool isNormalized {
// get { return start <= end; }
// }
//
// public string textBefore(string text) {
// D.assert(isNormalized);
// return text.Substring(0, start);
// }
//
// public string textAfter(string text) {
// D.assert(isNormalized);
// return text.Substring(end);
// }
//
// public string textInside(string text) {
// D.assert(isNormalized);
// return text.Substring(start, end - start);
// }
//
// public bool Equals(TextRange other) {
// if (ReferenceEquals(null, other)) {
// return false;
// }
//
// if (ReferenceEquals(this, other)) {
// return true;
// }
//
// return start == other.start && end == other.end;
// }
//
// public override bool Equals(object obj) {
// if (ReferenceEquals(null, obj)) {
// return false;
// }
//
// if (ReferenceEquals(this, obj)) {
// return true;
// }
//
// if (obj.GetType() != GetType()) {
// return false;
// }
//
// return Equals((TextRange) obj);
// }
//
// public override int GetHashCode() {
// unchecked {
// return (start * 397) ^ end;
// }
// }
//
// public static bool operator ==(TextRange left, TextRange right) {
// return Equals(left, right);
// }
//
// public static bool operator !=(TextRange left, TextRange right) {
// return !Equals(left, right);
// }
//
// public override string ToString() {
// return $"TextRange Start: {start}, End: {end}";
// }
// }
public class TextSelection : TextRange, IEquatable<TextSelection> {
public readonly int baseOffset;

1
com.unity.uiwidgets/Runtime/service/text_formatter.cs


using System;
using System.Text.RegularExpressions;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.service {

4
com.unity.uiwidgets/Runtime/service/text_input.cs


class TextInputConfiguration {
public TextInputConfiguration(TextInputType inputType = null,
bool obscureText = false, bool autocorrect = true, TextInputAction inputAction = TextInputAction.done,
Brightness keyboardAppearance = Brightness.light,
ui.Brightness keyboardAppearance = ui.Brightness.light,
TextCapitalization textCapitalization = TextCapitalization.none,
bool unityTouchKeyboard = false) {
this.inputType = inputType ?? TextInputType.text;

public readonly bool autocorrect;
public readonly TextInputAction inputAction;
public readonly TextCapitalization textCapitalization;
public readonly Brightness keyboardAppearance;
public readonly ui.Brightness keyboardAppearance;
public readonly bool unityTouchKeyboard;
public JSONNode toJson() {

2
com.unity.uiwidgets/Runtime/services/asset_bundle.cs


using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
using UnityEngine.Networking;
namespace Unity.UIWidgets.services {

2
com.unity.uiwidgets/Runtime/services/binary_messenger.cs


using System;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.services {
public delegate Future<byte[]> MessageHandler(byte[] message);

2
com.unity.uiwidgets/Runtime/services/binding.cs


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.services {
public class ServicesBinding : BindingBase {

2
com.unity.uiwidgets/Runtime/ui2/channel_buffers.cs


using Unity.UIWidgets.async2;
using UnityEngine;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
readonly struct _StoredMessage {
internal _StoredMessage(byte[] data, PlatformMessageResponseCallback callback) {
_data = data;

99
com.unity.uiwidgets/Runtime/ui2/compositing.cs


using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public class Scene : NativeWrapperDisposable {
internal Scene(IntPtr ptr) : base(ptr) {
}

return layer;
}
public ClipRectEngineLayer pushClipRect(
Rect rect,
Clip clipBehavior = Clip.antiAlias,
ClipRectEngineLayer oldLayer = null) {
D.assert(clipBehavior != Clip.none);
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushClipRect"));
ClipRectEngineLayer layer = new ClipRectEngineLayer(SceneBuilder_pushClipRect(_ptr, rect.left, rect.right, rect.top, rect.bottom, (int)clipBehavior));
D.assert(_debugPushLayer(layer));
return layer;
}
public unsafe ClipRRectEngineLayer pushClipRRect(
RRect rrect,
Clip clipBehavior = Clip.antiAlias,
ClipRRectEngineLayer oldLayer = null) {
D.assert(clipBehavior != Clip.none);
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushClipRRect"));
fixed (float* rrectPtr = rrect._value32) {
ClipRRectEngineLayer layer =
new ClipRRectEngineLayer(SceneBuilder_pushClipRRect(_ptr, rrectPtr, (int) clipBehavior));
D.assert(_debugPushLayer(layer));
return layer;
}
}
public ClipPathEngineLayer pushClipPath(
Path path,
Clip clipBehavior = Clip.antiAlias,
ClipPathEngineLayer oldLayer = null) {
D.assert(clipBehavior != Clip.none);
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushClipPath"));
ClipPathEngineLayer layer = new ClipPathEngineLayer(SceneBuilder_pushClipPath(_ptr, path._ptr, (int)clipBehavior));
D.assert(_debugPushLayer(layer));
return layer;
}
public OpacityEngineLayer pushOpacity(
int alpha,
Offset offset = null,
OpacityEngineLayer oldLayer = null) {
offset = offset ?? Offset.zero;
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushOpacity"));
OpacityEngineLayer layer = new OpacityEngineLayer(SceneBuilder_pushOpacity(_ptr, alpha, offset.dx, offset.dy));
D.assert(_debugPushLayer(layer));
return layer;
}
public BackdropFilterEngineLayer pushBackdropFilter(
ImageFilter filter,
BackdropFilterEngineLayer oldLayer = null) {
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "pushBackdropFilter"));
BackdropFilterEngineLayer layer = new BackdropFilterEngineLayer(SceneBuilder_pushBackdropFilter(_ptr, filter._toNativeImageFilter()._ptr));
D.assert(_debugPushLayer(layer));
return layer;
}
public PhysicalShapeEngineLayer pushPhysicalShape(
Path path,
float elevation,
Color color,
Color shadowColor,
Clip clipBehavior = Clip.none,
PhysicalShapeEngineLayer oldLayer = null) {
D.assert(_debugCheckCanBeUsedAsOldLayer(oldLayer, "PhysicalShapeEngineLayer"));
PhysicalShapeEngineLayer layer = new PhysicalShapeEngineLayer(SceneBuilder_pushPhysicalShape(_ptr, path._ptr, elevation, (int)color.value, (int)(shadowColor?.value ?? 0xFF000000), (int)clipBehavior));
D.assert(_debugPushLayer(layer));
return layer;
}
public void pop() {
if (_layerStack.isNotEmpty()) {
_layerStack.removeLast();

_EngineLayerWrapper wrapper = retainedLayer as _EngineLayerWrapper;
SceneBuilder_addRetained(_ptr, wrapper._ptr);
}
public void addPerformanceOverlay(int enabledOptions, Rect bounds) {
SceneBuilder_addPerformanceOverlay(enabledOptions, bounds.left, bounds.right, bounds.top, bounds.bottom);
}
public void addPicture(

[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushOffset(IntPtr ptr, float dx, float dy);
[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushClipRect(IntPtr ptr, float left, float right, float top, float bottom,
int clipBehavior);
[DllImport(NativeBindings.dllName)]
static extern unsafe IntPtr SceneBuilder_pushClipRRect(IntPtr ptr, float* rrect, int clipBehavior);
[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushClipPath(IntPtr ptr, IntPtr path, int clipBehavior);
[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushOpacity(IntPtr ptr, int alpha, float dx, float dy);
[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushBackdropFilter(IntPtr ptr, IntPtr filter);
[DllImport(NativeBindings.dllName)]
static extern void SceneBuilder_addPerformanceOverlay(int enabledOptions, float left, float right, float top,
float bottom);
[DllImport(NativeBindings.dllName)]
static extern IntPtr SceneBuilder_pushPhysicalShape(IntPtr ptr, IntPtr path, float evelation, int color,
int shadowColor, int clipBehavior);
[DllImport(NativeBindings.dllName)]
static extern void SceneBuilder_pop(IntPtr ptr);

2
com.unity.uiwidgets/Runtime/ui2/hooks.cs


using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public static class Hooks {
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]

2
com.unity.uiwidgets/Runtime/ui2/isolate.cs


using Unity.UIWidgets.foundation;
using UnityEngine;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public class Isolate {
static Dictionary<IntPtr, Isolate> _isolates = new Dictionary<IntPtr, Isolate>();

2
com.unity.uiwidgets/Runtime/ui2/native_bindings.cs


using System;
using Unity.UIWidgets.foundation;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public class NativeBindings {
#if (UNITY_IOS || UNITY_TVOS || UNITY_WEBGL) && !UNITY_EDITOR
internal const string dllName = "__Internal";

137
com.unity.uiwidgets/Runtime/ui2/painting.cs


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;

using Unity.UIWidgets.ui;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public static class Conversions {
public static UnityEngine.Color toColor(this Color color) {
return new UnityEngine.Color(

}
}
public unsafe void addPath(Path path, Offset offset, float[] matrix4) {
public unsafe void addPath(Path path, Offset offset, float[] matrix4 = null) {
D.assert(path != null); // path is checked on the engine side
D.assert(PaintingUtils._offsetIsValid(offset));

throw new Exception(
"Path.combine() failed. This may be due an invalid path; in particular, check for NaN values.");
}
public PathMetrics computeMetrics(bool forceClose = false) {
return new PathMetrics(this, forceClose);
}

}
}
public class PathMetrics : IEnumerable<PathMetric> {
public PathMetrics(Path path, bool forceClosed) {
_iterator = new PathMetricIterator(new _PathMeasure(path, forceClosed));
}
readonly IEnumerator<PathMetric> _iterator;
public IEnumerator<PathMetric> GetEnumerator() {
return _iterator;
}
IEnumerator IEnumerable.GetEnumerator() {
return GetEnumerator();
}
}
public class PathMetricIterator : IEnumerator<PathMetric> {
public PathMetricIterator(_PathMeasure pathMeasure) {
D.assert(pathMeasure != null);
_pathMeasure = pathMeasure;
}
PathMetric _pathMetric;
readonly _PathMeasure _pathMeasure;
public bool MoveNext() {
if (_pathMeasure._nextContour()) {
_pathMetric = new PathMetric(_pathMeasure);
return true;
}
_pathMetric = null;
return false;
}
public void Reset() {
D.assert(false, () => "PathMetricIterator.Reset is not implemented yet !");
}
public PathMetric Current {
get {
PathMetric currentMetric = _pathMetric;
if (currentMetric == null) {
throw new Exception("PathMetricIterator is not pointing to a PathMetric. This can happen in two situations:\n" +
"- The iteration has not started yet. If so, call \"moveNext\" to start iteration." +
"- The iterator ran out of elements. If so, check that \"moveNext\" returns true prior to calling \"current\".");
}
return currentMetric;
}
}
object IEnumerator.Current {
get { return Current; }
}
public void Dispose() {
}
}
public class PathMetric {
public PathMetric(_PathMeasure measure) {
D.assert(measure != null);
_measure = measure;
length = _measure.length(_measure.currentContourIndex);
isClosed = _measure.isClosed(_measure.currentContourIndex);
contourIndex = _measure.currentContourIndex;
}
public readonly float length;
public readonly bool isClosed;
public readonly int contourIndex;
readonly _PathMeasure _measure;
}
public class _PathMeasure : NativeWrapper {
public _PathMeasure(Path path, bool forceClosed) : base(PathMeasure_constructor(path._ptr, forceClosed)) {
}
protected override void DisposePtr(IntPtr ptr) {
PathMeasure_dispose(ptr);
}
public int currentContourIndex = -1;
public float length(int contourIndex) {
D.assert(contourIndex <= currentContourIndex, () => $"Iterator must be advanced before index {contourIndex} can be used.");
return PathMeasure_length(contourIndex);
}
public bool isClosed(int contourIndex) {
D.assert(contourIndex <= currentContourIndex, () => $"Iterator must be advanced before index {contourIndex} can be used.");
return PathMeasure_isClosed(contourIndex);
}
public bool _nextContour() {
bool next = PathMeasure_nativeNextContour();
if (next) {
currentContourIndex++;
}
return next;
}
[DllImport(NativeBindings.dllName)]
static extern IntPtr PathMeasure_constructor(IntPtr path, bool forcedClosed);
[DllImport(NativeBindings.dllName)]
static extern void PathMeasure_dispose(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
static extern float PathMeasure_length(int contourIndex);
[DllImport(NativeBindings.dllName)]
static extern bool PathMeasure_isClosed(int contourIndex);
[DllImport(NativeBindings.dllName)]
static extern bool PathMeasure_nativeNextContour();
}
public class ColorFilter : IEquatable<ColorFilter> {
ColorFilter(Color color, BlendMode? blendMode, float[] matrix, int type) {
_color = color;

}
}
class _ImageFilter : NativeWrapper {
internal class _ImageFilter : NativeWrapper {
_ImageFilter(IntPtr ptr, ImageFilter creator) : base(ptr) {
this.creator = creator;
}

4
com.unity.uiwidgets/Runtime/ui2/text.cs


using Unity.UIWidgets.services;
using Rect = Unity.UIWidgets.ui.Rect;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public enum FontStyle {
normal,

public readonly TextDirection direction;
Rect toRect() => Rect.fromLTRB((float) left, (float) top, (float) right, (float) bottom);
public Rect toRect() => Rect.fromLTRB((float) left, (float) top, (float) right, (float) bottom);
public float start {
get { return (direction == TextDirection.ltr) ? left : right; }

179
com.unity.uiwidgets/Runtime/ui2/window.cs


using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.ui2 {
namespace Unity.UIWidgets.ui {
public delegate void VoidCallback();
public delegate void FrameCallback(TimeSpan duration);

}
}
public class Locale : IEquatable<Locale> {
public Locale(string languageCode, string countryCode = null) {
D.assert(languageCode != null);
_languageCode = languageCode;
_countryCode = countryCode;
}
public Locale(string languageCode, string countryCode = null, string scriptCode = null) {
D.assert(languageCode != null);
_languageCode = languageCode;
_countryCode = countryCode;
_scriptCode = scriptCode;
}
public static Locale fromSubtags(
string languageCode = "und",
string scriptCode = null,
string countryCode = null
) {
D.assert(languageCode != null); // ignore: unnecessary_null_comparison
D.assert(languageCode != "");
D.assert(scriptCode != "");
D.assert(countryCode != "");
return new Locale(languageCode, countryCode, scriptCode);
}
readonly string _languageCode;
public string languageCode {
get { return _languageCode; }
}
readonly string _countryCode;
public string countryCode {
get { return _countryCode; }
}
readonly string _scriptCode;
public string scriptCode { get; }
public bool Equals(Locale other) {
if (ReferenceEquals(null, other)) {
return false;
}
if (ReferenceEquals(this, other)) {
return true;
}
return string.Equals(_languageCode, other._languageCode) &&
string.Equals(_countryCode, other._countryCode);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj)) {
return false;
}
if (ReferenceEquals(this, obj)) {
return true;
}
if (obj.GetType() != GetType()) {
return false;
}
return Equals((Locale) obj);
}
public override int GetHashCode() {
unchecked {
return ((_languageCode != null ? _languageCode.GetHashCode() : 0) * 397) ^
(_countryCode != null ? _countryCode.GetHashCode() : 0);
}
}
public static bool operator ==(Locale left, Locale right) {
return Equals(left, right);
}
public static bool operator !=(Locale left, Locale right) {
return !Equals(left, right);
}
public override string ToString() {
if (countryCode == null) {
return languageCode;
}
return $"{languageCode}_{countryCode}";
}
}
public class Window {
internal IntPtr _ptr;
internal object _binding;

public VoidCallback onMetricsChanged { get; set; }
public Locale locale {
get {
if (_locales != null && _locales.isNotEmpty()) {
return _locales.first();
}
return null;
}
}
List<Locale> _locales;
public List<Locale> locales { get; }
Locale computePlatformResolvedLocale(List<Locale> supportedLocales) {
List<string> supportedLocalesData = new List<string>();
foreach (Locale locale in supportedLocales) {
supportedLocalesData.Add(locale.languageCode);
supportedLocalesData.Add(locale.countryCode);
supportedLocalesData.Add(locale.scriptCode);
}
List<string> result = _computePlatformResolvedLocale(supportedLocalesData);
if (result.isNotEmpty()) {
return Locale.fromSubtags(
languageCode: result[0],
countryCode: result[1] == "" ? null : result[1],
scriptCode: result[2] == "" ? null : result[2]);
}
return null;
}
List<string> _computePlatformResolvedLocale(List<string> supportedLocalesData) =>
Window_computePlatformResolvedLocale(supportedLocalesData);
/// A callback that is invoked whenever [locale] changes value.
///
/// The framework invokes this callback in the same zone in which the
/// callback was set.
///
/// See also:
///
/// * [WidgetsBindingObserver], for a mechanism at the widgets layer to
/// observe when this callback is invoked.
public VoidCallback onLocaleChanged {
get { return _onLocaleChanged; }
set {
_onLocaleChanged = value;
_onLocaleChangedZone = Zone.current;
}
}
VoidCallback _onLocaleChanged;
Zone _onLocaleChangedZone = Zone.root;
public string initialLifecycleState {
get {
_initialLifecycleStateAccessed = true;

string _initialLifecycleState;
string _initialLifecycleState = "AppLifecycleState.resumed";
bool _initialLifecycleStateAccessed = false;
public float textScaleFactor { get; internal set; } = 1.0f;

}
}
public Offset windowPosToScreenPos(Offset offset) {
D.assert(false, () => "window.windowPosToScreenPos is not implemented yet!");
return offset;
}
public void run(Action callback) {
//Fixme: do nothing now
D.assert(false, () => "window.run is not implemented yet!");
}
public PointerDataPacketCallback onPointerDataPacket {
get { return _onPointerDataPacket; }
set {

public void scheduleFrame() {
Window_scheduleFrame(_ptr);
}
public void scheduleMicrotask(Action callback) {
async_.scheduleMicrotask(() => {
callback.Invoke();
return null;
});
}
public void render(Scene scene) {

[DllImport(NativeBindings.dllName)]
static extern void Window_freeDefaultRouteName(IntPtr routeNamePtr);
[DllImport(NativeBindings.dllName)]
static extern List<string> Window_computePlatformResolvedLocale(List<string> supportedLocalesData);
[MonoPInvokeCallback(typeof(Window_sendPlatformMessageCallback))]
static unsafe void _sendPlatformMessageCallback(IntPtr callbackHandle, byte* data, int dataLength) {

2
com.unity.uiwidgets/Runtime/widgets/animated_size.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
namespace Unity.UIWidgets.widgets {
public class AnimatedSize : SingleChildRenderObjectWidget {

1
com.unity.uiwidgets/Runtime/widgets/animated_switcher.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG.Promises;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;

24
com.unity.uiwidgets/Runtime/widgets/app.cs


using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.editor;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

}
public static Window of(GameObject gameObject) {
D.assert(false, () => "window.Of is not implemented yet!");
return null;
/*
*/
#if UNITY_EDITOR
public static Window of(UIWidgetsEditorWindow editorWindow) {
return editorWindow.window;
}
#endif
public override bool updateShouldNotify(InheritedWidget oldWidget) {
D.assert(window == ((WindowProvider) oldWidget).window);

class _WidgetsAppState : State<WidgetsApp>, WidgetsBindingObserver {
GlobalKey<NavigatorState> _navigator;
public IPromise<bool> didPopRoute() {
public Future<bool> didPopRoute() {
return Promise<bool>.Resolved(false);
return Future<bool>.value(false).to<bool>();
public IPromise<bool> didPushRoute(string route) {
public Future<bool> didPushRoute(string route) {
return Promise<bool>.Resolved(false);
return Future<bool>.value(false).to<bool>();
return Promise<bool>.Resolved(true);
return Future<bool>.value(true).to<bool>();
}
public void didChangeMetrics() {

20
com.unity.uiwidgets/Runtime/widgets/automatic_keep_alive.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {

if (!mounted) {
return;
}
ParentDataElement childElement1 = _getChildElement();
D.assert(childElement1 != null);
_updateParentDataOfChild(childElement1);

}
else {
_keepingAlive = false;
Window.instance.scheduleMicrotask(() => {
async_.scheduleMicrotask(() => {
return null;
});
}
}

return null;
}
}
public abstract class AutomaticKeepAliveClientWithTickerProviderStateMixin<T> : State<T>, TickerProvider
where T : StatefulWidget {
HashSet<Ticker> _tickers;

Func<string> debugLabel = null;
D.assert(() => {
debugLabel = () => "created by " + this;
return true;
});
var result = new _AutomaticWidgetTicker<T>(onTick, this, debugLabel: debugLabel);
var result = new _AutomaticWidgetTicker<T>(onTick, this,
debugLabel: foundation_.kDebugMode ? "created by " + this : null);
_tickers.Add(result);
return result;
}

9
com.unity.uiwidgets/Runtime/widgets/basic.cs


using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;
using Rect = Unity.UIWidgets.ui.Rect;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
namespace Unity.UIWidgets.widgets {
public class Directionality : InheritedWidget {

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool invertColors = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) : base(key) {
this.image = image;
this.width = width;

this.centerSlice = centerSlice;
this.invertColors = invertColors;
this.filterMode = filterMode;
this.filterQuality = filterQuality;
}
public readonly ui.Image image;

public readonly ImageRepeat repeat;
public readonly Rect centerSlice;
public readonly bool invertColors;
public readonly FilterQuality filterQuality;
public override RenderObject createRenderObject(BuildContext context) {
return new RenderImage(

repeat: repeat,
centerSlice: centerSlice,
invertColors: invertColors,
filterMode: filterMode
filterQuality: filterQuality
);
}

renderImage.repeat = repeat;
renderImage.centerSlice = centerSlice;
renderImage.invertColors = invertColors;
renderImage.filterMode = filterMode;
renderImage.filterQuality = filterQuality;
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {

79
com.unity.uiwidgets/Runtime/widgets/binding.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using UnityEngine;

void didChangeLocales(List<Locale> locale);
IPromise<bool> didPopRoute();
Future<bool> didPopRoute();
IPromise<bool> didPushRoute(string route);
Future<bool> didPushRoute(string route);
}
public static partial class ui_ {
public static void Each<T>(this IEnumerable<T> source, Action<T> fn) {
foreach (var item in source) {
fn.Invoke(item);
}
}
public static void Each<T>(this IEnumerable<T> source, Action<T, int> fn) {
int index = 0;
foreach (T item in source) {
fn.Invoke(item, index);
index++;
}
}
/// <summary>
/// Convert a variable length argument list of items to an enumerable.
/// </summary>
public static IEnumerable<T> FromItems<T>(params T[] items) {
foreach (var item in items) {
yield return item;
}
}
public static void runApp(Widget app) {
var instance = WidgetsFlutterBinding.ensureInitialized();
instance.scheduleAttachRootWidget(app);
instance.scheduleWarmUpFrame();
}
}
public class WidgetsBinding : RendererBinding {

buildOwner.onBuildScheduled = _handleBuildScheduled;
Window.instance.onLocaleChanged += handleLocaleChanged;
widgetInspectorService = new WidgetInspectorService(this);
addPersistentFrameCallback((duration) => {
TextBlobMesh.tickNextFrame();
TessellationGenerator.tickNextFrame();
uiTessellationGenerator.tickNextFrame();
uiPathCacheManager.tickNextFrame();
});
// addPersistentFrameCallback((duration) => {
// TextBlobMesh.tickNextFrame();
// TessellationGenerator.tickNextFrame();
// uiTessellationGenerator.tickNextFrame();
// uiPathCacheManager.tickNextFrame();
// });
}
public BuildOwner buildOwner {

public void handlePopRoute() {
var idx = -1;
void _handlePopRouteSub(bool result) {
if (!result) {
idx++;

}
_observers[idx].didPopRoute().Then((Action<bool>) _handlePopRouteSub);
_observers[idx].didPopRoute().then_(_handlePopRouteSub);
_handlePopRouteSub(false);
}

observer.didChangeTextScaleFactor();
}
}
protected override void handlePlatformBrightnessChanged() {
base.handlePlatformBrightnessChanged();
foreach (WidgetsBindingObserver observer in _observers) {

if (_renderViewElement == null) {
return;
}
}
internal void scheduleAttachRootWidget(Widget rootWidget) {
Timer.run(() => {
attachRootWidget(rootWidget);
return null;
});
}
public void attachRootWidget(Widget rootWidget) {

protected override void removeChildRenderObject(RenderObject child) {
D.assert(renderObject.child == child);
renderObject.child = null;
}
}
public class WidgetsFlutterBinding : WidgetsBinding {
public static WidgetsBinding ensureInitialized() {
if (WidgetsBinding.instance == null)
new WidgetsFlutterBinding();
return WidgetsBinding.instance;
}
}
}

21
com.unity.uiwidgets/Runtime/widgets/dismissible.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.scheduler2;
public delegate Promise<bool> ConfirmDismissCallback(DismissDirection? direction);
public delegate Future<bool> ConfirmDismissCallback(DismissDirection? direction);
public enum DismissDirection {
vertical,

internal _AutomaticWidgetTicker(
TickerCallback onTick,
AutomaticKeepAliveClientWithTickerProviderStateMixin<T> creator,
Func<string> debugLabel = null) :
string debugLabel = null) :
base(onTick: onTick, debugLabel: debugLabel) {
_creator = creator;
}

public override void dispose() {
public override void Dispose() {
base.dispose();
base.Dispose();
}
}

}
_dragUnderway = false;
_confirmStartResizeAnimation().Then((value) => {
_confirmStartResizeAnimation().then_((value) => {
if (_moveController.isCompleted && value) {
_startResizeAnimation();
}

void _handleDismissStatusChanged(AnimationStatus status) {
if (status == AnimationStatus.completed && !_dragUnderway) {
_confirmStartResizeAnimation().Then((value) => {
_confirmStartResizeAnimation().then_((value) => {
if (value) {
_startResizeAnimation();
}

}
}
IPromise<bool> _confirmStartResizeAnimation() {
Future<bool> _confirmStartResizeAnimation() {
if (widget.confirmDismiss != null) {
DismissDirection? direction = _dismissDirection;
D.assert(direction != null);

return Promise<bool>.Resolved(true);
return Future<bool>.value(true).to<bool>();
}
void _startResizeAnimation() {

28
com.unity.uiwidgets/Runtime/widgets/editable_text.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Brightness = Unity.UIWidgets.ui.Brightness;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.widgets {

public void didChangeLocales(List<Locale> locale) {
}
public IPromise<bool> didPopRoute() {
return Promise<bool>.Resolved(false);
public Future<bool> didPopRoute() {
return Future<bool>.value(false).to<bool>();
public IPromise<bool> didPushRoute(string route) {
return Promise<bool>.Resolved(false);
public Future<bool> didPushRoute(string route) {
return Future<bool>.value(false).to<bool>();
}
void _formatAndSetValue(TextEditingValue value, bool isIMEInput = false) {

int _obscureShowCharTicksPending = 0;
int _obscureLatestCharIndex;
void _cursorTick() {
object _cursorTick(object timer) {
_targetCursorVisibility = !_unityKeyboard() && !_targetCursorVisibility;
float targetOpacity = _targetCursorVisibility ? 1.0f : 0.0f;
if (widget.cursorOpacityAnimates) {

if (_obscureShowCharTicksPending > 0) {
setState(() => { _obscureShowCharTicksPending--; });
}
return null;
void _cursorWaitForStart() {
object _cursorWaitForStart(object timer) {
_cursorTimer = Window.instance.run(_kCursorBlinkHalfPeriod, _cursorTick, periodic: true);
_cursorTimer = Timer.periodic(_kCursorBlinkHalfPeriod, _cursorTick);
return null;
}
void _startCursorTimer() {

if (widget.cursorOpacityAnimates) {
_cursorTimer =
Window.instance.run(_kCursorBlinkWaitForStart, _cursorWaitForStart, periodic: true);
Timer.periodic(_kCursorBlinkWaitForStart, _cursorWaitForStart);
_cursorTimer = Window.instance.run(_kCursorBlinkHalfPeriod, _cursorTick, periodic: true);
_cursorTimer = Timer.periodic(_kCursorBlinkHalfPeriod, _cursorTick);
}
}

15
com.unity.uiwidgets/Runtime/widgets/focus_manager.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

}
}
public void requestFocus(FocusNode node) {
D.assert(node != null);
// TODO: need update
public void requestFocus(FocusNode node = null) {
// D.assert(node != null);
_focusPath.SequenceEqual(focusPath)))) {
_focusPath.SequenceEqual(focusPath)))) {
return;
}

node._hasKeyboardToken = true;
_setFocus(node);
}
public void autofocus(FocusNode node) {
D.assert(node != null);
if (_focus == null) {

}
_haveScheduledUpdate = true;
Window.instance.scheduleMicrotask(_update);
async_.scheduleMicrotask(() => {
_update();
return null;
});
}
internal FocusNode _findNextFocus() {

47
com.unity.uiwidgets/Runtime/widgets/image.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;

);
}
public IPromise precacheImage(
public Future precacheImage(
ImageProvider provider,
BuildContext context,
Size size = null,

var completer = new Promise();
var completer = Completer.create();
completer.Resolve();
stream.removeListener(listener);
if (!completer.isCompleted) {
stream.removeListener(listener);
}
SchedulerBinding.instance.addPostFrameCallback(timeStamp => { stream.removeListener(listener); });
completer.Resolve();
if (!completer.isCompleted) {
completer.complete();
}
stream.removeListener(listener);
if (onError != null) {
onError(exception);

}
stream.addListener(listener, onError: errorListener);
return completer;
return completer.future;
}
}

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool gaplessPlayback = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) : base(key) {
D.assert(image != null);
this.image = image;

this.repeat = repeat;
this.centerSlice = centerSlice;
this.gaplessPlayback = gaplessPlayback;
this.filterMode = filterMode;
this.filterQuality = filterQuality;
}
public static Image network(

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool gaplessPlayback = false,
FilterMode filterMode = FilterMode.Bilinear,
FilterQuality filterQuality = FilterQuality.low,
IDictionary<string, string> headers = null
) {
var networkImage = new NetworkImage(src, scale, headers);

repeat,
centerSlice,
gaplessPlayback,
filterMode
filterQuality
);
}

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool gaplessPlayback = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) {
var fileImage = new FileImage(file, scale);
return new Image(

repeat,
centerSlice,
gaplessPlayback,
filterMode
filterQuality
);
}

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool gaplessPlayback = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) {
var image = scale != null
? (AssetBundleImageProvider) new ExactAssetImage(name, bundle: bundle, scale: scale.Value)

repeat,
centerSlice,
gaplessPlayback,
filterMode
filterQuality
);
}

ImageRepeat repeat = ImageRepeat.noRepeat,
Rect centerSlice = null,
bool gaplessPlayback = false,
FilterMode filterMode = FilterMode.Bilinear
FilterQuality filterQuality = FilterQuality.low
) {
var memoryImage = new MemoryImage(bytes, scale);
return new Image(

repeat,
centerSlice,
gaplessPlayback,
filterMode
filterQuality
);
}

public readonly Color color;
public readonly FilterMode filterMode;
public readonly FilterQuality filterQuality;
public readonly BlendMode colorBlendMode;
public readonly BoxFit? fit;
public readonly Alignment alignment;

properties.add(new EnumProperty<ImageRepeat>("repeat", repeat, defaultValue: ImageRepeat.noRepeat));
properties.add(new DiagnosticsProperty<Rect>("centerSlice", centerSlice,
defaultValue: foundation_.kNullDefaultValue));
properties.add(new EnumProperty<FilterMode>("filterMode", filterMode, foundation_.kNullDefaultValue));
properties.add(new EnumProperty<FilterQuality>("filterQuality", filterQuality, foundation_.kNullDefaultValue));
}
}

repeat: widget.repeat,
centerSlice: widget.centerSlice,
invertColors: _invertColors,
filterMode: widget.filterMode
filterQuality: widget.filterQuality
);
return image;

13
com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;

}
}
public IPromise animateToItem(
public Future animateToItem(
return Promise.Resolved();
return null;
List<IPromise> futures = new List<IPromise>();
List<Future> futures = new List<Future>();
foreach (_FixedExtentScrollPosition position in positions) {
futures.Add(position.animateTo(
itemIndex * position.itemExtent,

}
return Promise.All(futures);
return Future.wait<object>(futures);
}
public void jumpToItem(int itemIndex) {

42
com.unity.uiwidgets/Runtime/widgets/localizations.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.async2;
public _Pending(LocalizationsDelegate del, IPromise<object> futureValue) {
public _Pending(LocalizationsDelegate del, Future<object> futureValue) {
public readonly IPromise<object> futureValue;
public readonly Future<object> futureValue;
internal static IPromise<Dictionary<Type, object>> _loadAll(Locale locale,
internal static Future<Dictionary<Type, object>> _loadAll(Locale locale,
IEnumerable<LocalizationsDelegate> allDelegates) {
Dictionary<Type, object> output = new Dictionary<Type, object>();
List<_Pending> pendingList = null;

}
foreach (LocalizationsDelegate del in delegates) {
IPromise<object> inputValue = del.load(locale);
Future<WidgetsLocalizations> inputValue = del.load(locale);
IPromise<object> futureValue = inputValue.Then(value => { return completedValue = value; });
Future<object> futureValue = inputValue.then_(value => {
completedValue = value;
return FutureOr.value(completedValue);
}).to<object>();
if (completedValue != null) {
Type type = del.type;
D.assert(!output.ContainsKey(type));

}
if (pendingList == null) {
return Promise<Dictionary<Type, object>>.Resolved(output);
return Future<Dictionary<Type, object>>.value(output).to<Dictionary<Type, object>>();
return Promise<object>.All(pendingList.Select(p => p.futureValue))
.Then(values => {
var list = values.ToList();
return Future<object>.wait<object>(pendingList.Select(p => p.futureValue))
.then(values => {
//TODO : check values is list
var list = (List<object>)values;
D.assert(list.Count == pendingList.Count);
for (int i = 0; i < list.Count; i += 1) {
Type type = pendingList[i].del.type;

return output;
});
}).to<Dictionary<Type, object>>();
}
}

public abstract bool isSupported(Locale locale);
public abstract IPromise<object> load(Locale locale);
public abstract Future<WidgetsLocalizations> load(Locale locale);
public abstract bool shouldReload(LocalizationsDelegate old);

return true;
}
public override IPromise<object> load(Locale locale) {
public override Future<WidgetsLocalizations> load(Locale locale) {
return DefaultWidgetsLocalizations.load(locale);
}

public DefaultWidgetsLocalizations() {
}
public static IPromise<object> load(Locale locale) {
return Promise<object>.Resolved(new DefaultWidgetsLocalizations());
public static Future<WidgetsLocalizations> load(Locale locale) {
return new SynchronousFuture<WidgetsLocalizations>(new DefaultWidgetsLocalizations());
}
public static readonly LocalizationsDelegate<WidgetsLocalizations> del = new _WidgetsLocalizationsDelegate();

}
Dictionary<Type, object> typeToResources = null;
IPromise<Dictionary<Type, object>> typeToResourcesFuture = _Pending._loadAll(locale, delegates)
.Then(value => { return typeToResources = value; });
Future<Dictionary<Type, object>> typeToResourcesFuture = _Pending._loadAll(locale, delegates)
.then(value => { return FutureOr.value(typeToResources = (Dictionary<Type, object>)value); }).to<Dictionary<Type, object>>();
if (typeToResources != null) {
_typeToResources = typeToResources;

// WidgetsBinding.instance.deferFirstFrameReport();
typeToResourcesFuture.Then(value => {
typeToResourcesFuture.then(value => {
// WidgetsBinding.instance.allowFirstFrameReport();
if (!mounted) {
return;

_typeToResources = value;
_typeToResources = (Dictionary<Type, object>)value;
_locale = locale;
});
});

1
com.unity.uiwidgets/Runtime/widgets/media_query.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Brightness = Unity.UIWidgets.ui.Brightness;
namespace Unity.UIWidgets.widgets {
public enum Orientation {

65
com.unity.uiwidgets/Runtime/widgets/navigator.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using RSG.Promises;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using SchedulerBinding = Unity.UIWidgets.scheduler2.SchedulerBinding;
using SchedulerPhase = Unity.UIWidgets.scheduler2.SchedulerPhase;
namespace Unity.UIWidgets.widgets {
public delegate Route RouteFactory(RouteSettings settings);

public delegate IPromise<bool> WillPopCallback();
public delegate Future<bool> WillPopCallback();
public enum RoutePopDisposition {
pop,

}
protected internal virtual TickerFuture didPush() {
return TickerFutureImpl.complete();
var future = TickerFuture.complete();
future.then(o => {
navigator?.focusScopeNode?.requestFocus();
});
return future;
public virtual IPromise<RoutePopDisposition> willPop() {
return Promise<RoutePopDisposition>.Resolved(isFirst
public virtual Future<RoutePopDisposition> willPop() {
return Future<RoutePopDisposition>.value(isFirst
: RoutePopDisposition.pop);
: RoutePopDisposition.pop).to<RoutePopDisposition>();
}
public virtual bool willHandlePopInternally {

get { return null; }
}
public IPromise<object> popped {
get { return _popCompleter; }
public Future popped {
get { return _popCompleter.future; }
internal readonly Promise<object> _popCompleter = new Promise<object>();
internal readonly Completer _popCompleter = Completer.create();
protected internal virtual bool didPop(object result) {
didComplete(result);

protected internal virtual void didComplete(object result) {
_popCompleter.Resolve(result);
_popCompleter.complete(FutureOr.value(result ?? currentResult));
}
protected internal virtual void didPopNext(Route nextRoute) {

public static readonly string defaultRouteName = "/";
public static IPromise<object> pushNamed(BuildContext context, string routeName, object arguments = null) {
public static Future pushNamed(BuildContext context, string routeName, object arguments = null) {
public static IPromise<object> pushReplacementNamed(BuildContext context, string routeName,
public static Future pushReplacementNamed(BuildContext context, string routeName,
public static IPromise<object> popAndPushNamed(BuildContext context, string routeName, object result = null,
public static Future popAndPushNamed(BuildContext context, string routeName, object result = null,
public static IPromise<object> pushNamedAndRemoveUntil(BuildContext context, string newRouteName,
public static Future pushNamedAndRemoveUntil(BuildContext context, string newRouteName,
public static IPromise<object> push(BuildContext context, Route route) {
public static Future push(BuildContext context, Route route) {
public static IPromise<object> pushReplacement(BuildContext context, Route newRoute, object result = null) {
public static Future pushReplacement(BuildContext context, Route newRoute, object result = null) {
public static IPromise<object> pushAndRemoveUntil(BuildContext context, Route newRoute,
public static Future pushAndRemoveUntil(BuildContext context, Route newRoute,
RoutePredicate predicate) {
return of(context).pushAndRemoveUntil(newRoute, predicate);
}

return navigator != null && navigator.canPop();
}
public static IPromise<bool> maybePop(BuildContext context, object result = null) {
public static Future<bool> maybePop(BuildContext context, object result = null) {
return of(context).maybePop(result);
}

return route;
}
public IPromise<object> pushNamed(string routeName, object arguments = null) {
public Future pushNamed(string routeName, object arguments = null) {
public IPromise<object> pushReplacementNamed(string routeName, object result = null, object arguments = null) {
public Future pushReplacementNamed(string routeName, object result = null, object arguments = null) {
public IPromise<object> popAndPushNamed(string routeName, object result = null, object arguments = null) {
public Future popAndPushNamed(string routeName, object result = null, object arguments = null) {
public IPromise<object> pushNamedAndRemoveUntil(string newRouteName, RoutePredicate predicate,
public Future pushNamedAndRemoveUntil(string newRouteName, RoutePredicate predicate,
public IPromise<object> push(Route route) {
public Future push(Route route) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;

_cancelActivePointers();
}
public IPromise<object> pushReplacement(Route newRoute, object result = null) {
public Future pushReplacement(Route newRoute, object result = null) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;

return newRoute.popped;
}
public IPromise<object> pushAndRemoveUntil(Route newRoute, RoutePredicate predicate) {
public Future pushAndRemoveUntil(Route newRoute, RoutePredicate predicate) {
D.assert(!_debugLocked);
D.assert(() => {
_debugLocked = true;

return _history.Count > 1 || _history[0].willHandlePopInternally;
}
public IPromise<bool> maybePop(object result = null) {
public Future<bool> maybePop(object result = null) {
return route.willPop().Then(disposition => {
return route.willPop().then_(disposition => {
if (disposition != RoutePopDisposition.bubble && mounted) {
if (disposition == RoutePopDisposition.pop) {
pop(result);

}
return false;
});
}).to<bool>();
}
public bool pop(object result = null) {

12
com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;

_outerPosition.updateCanDrag(maxInnerExtent);
}
public IPromise animateTo(float to,
public Future animateTo(float to,
TimeSpan duration,
Curve curve
) {

curve
);
List<IPromise> resultFutures = new List<IPromise> {outerActivity.done};
List<Future> resultFutures = new List<Future> {outerActivity.done};
beginActivity(
outerActivity,
(_NestedScrollPosition position) => {

return innerActivity;
}
);
return Promise.All(resultFutures);
return Future.wait<object>(resultFutures);
}
public void jumpTo(float to) {

return null;
}
public override IPromise animateTo(float to,
public override Future animateTo(float to,
TimeSpan duration,
Curve curve
) {

2
com.unity.uiwidgets/Runtime/widgets/overlay.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {

13
com.unity.uiwidgets/Runtime/widgets/overscroll_indicator.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;

public override void dispose() {
_glowController.dispose();
_displacementTicker.dispose();
_displacementTicker.Dispose();
_pullRecedeTimer?.cancel();
base.dispose();
}

}
_pullRecedeTimer =
Window.instance.run(_pullHoldTime, () => _recede(_pullDecayTime));
Timer.create(_pullHoldTime, () => {
_recede(_pullDecayTime);
return null;
});
}
public void scrollEnd() {

if (_displacementTickerLastElapsed != null) {
float? t = elapsed.Milliseconds - _displacementTickerLastElapsed?.Milliseconds;
_displacement = _displacementTarget - (_displacementTarget - _displacement) *
Mathf.Pow(2.0f, (-t ?? 0.0f) / _crossAxisHalfTime.Milliseconds);
Mathf.Pow(2.0f, (-t ?? 0.0f) / _crossAxisHalfTime.Milliseconds);
notifyListeners();
}

8
com.unity.uiwidgets/Runtime/widgets/page_view.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

}
}
public IPromise animateToPage(int page, TimeSpan duration, Curve curve) {
public Future animateToPage(int page, TimeSpan duration, Curve curve) {
_PagePosition position = (_PagePosition) this.position;
return position.animateTo(
position.getPixelsFromPage(page),

position.jumpTo(position.getPixelsFromPage(page));
}
public IPromise nextPage(TimeSpan duration, Curve curve) {
public Future nextPage(TimeSpan duration, Curve curve) {
public IPromise previousPage(TimeSpan duration, Curve curve) {
public Future previousPage(TimeSpan duration, Curve curve) {
return animateToPage(page.round() - 1, duration: duration, curve: curve);
}

105
com.unity.uiwidgets/Runtime/widgets/routes.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {

) : base(settings) {
}
public IPromise<object> completed {
get { return _transitionCompleter; }
public Future completed {
get { return _transitionCompleter.future; }
internal readonly Promise<object> _transitionCompleter = new Promise<object>();
internal readonly Completer _transitionCompleter = Completer.create();
public virtual TimeSpan transitionDuration { get; }

internal AnimationController _controller;
public virtual AnimationController createAnimationController() {
D.assert(_transitionCompleter.CurState == PromiseState.Pending,
D.assert(!_transitionCompleter.isCompleted,
() => $"Cannot reuse a {GetType()} after disposing it.");
TimeSpan duration = transitionDuration;
D.assert(duration >= TimeSpan.Zero);

}
public virtual Animation<float> createAnimation() {
D.assert(_transitionCompleter.CurState == PromiseState.Pending,
D.assert(!_transitionCompleter.isCompleted,
() => $"Cannot reuse a {GetType()} after disposing it.");
D.assert(_controller != null);
return _controller.view;

protected internal override void dispose() {
D.assert(!_transitionCompleter.isCompleted, () => $"Cannot dispose a {GetType()} twice.");
_controller?.dispose();
_transitionCompleter.Resolve(_result);
_transitionCompleter.complete(FutureOr.value(_result));
base.dispose();
}

}
}
public override IPromise<RoutePopDisposition> willPop() {
public override Future<RoutePopDisposition> willPop() {
return Promise<RoutePopDisposition>.Resolved(RoutePopDisposition.pop);
return Future<RoutePopDisposition>.value(RoutePopDisposition.pop).to<RoutePopDisposition>();
}
return base.willPop();

public override Widget build(BuildContext context) {
_page = _page ?? new RepaintBoundary(
key: widget.route._subtreeKey, // immutable
child: new Builder(
builder: (BuildContext _context) => widget.route.buildPage(
_context,
widget.route.animation,
widget.route.secondaryAnimation
))
);
key: widget.route._subtreeKey, // immutable
child: new Builder(
builder: (BuildContext _context) => widget.route.buildPage(
_context,
widget.route.animation,
widget.route.secondaryAnimation
))
);
return new _ModalScopeStatus(
route: widget.route,

}
public abstract class ModalRoute : LocalHistoryRouteTransitionRoute {
protected ModalRoute() {}
protected ModalRoute(RouteSettings settings) : base(settings) { }
protected ModalRoute() {
}
protected ModalRoute(RouteSettings settings) : base(settings) {
}
public static Color _kTransparent = new Color(0x00000000);

readonly List<WillPopCallback> _willPopCallbacks = new List<WillPopCallback>();
public override IPromise<RoutePopDisposition> willPop() {
public override Future<RoutePopDisposition> willPop() {
var callbacks = new List<WillPopCallback>(_willPopCallbacks);
Promise<RoutePopDisposition> result = new Promise<RoutePopDisposition>();
Action<int> fn = null;
fn = (int index) => {
if (index < callbacks.Count) {
callbacks[index]().Then((pop) => {
if (!pop) {
result.Resolve(RoutePopDisposition.doNotPop);
}
else {
fn(index + 1);
}
});
bool result = false;
foreach (WillPopCallback callback in _willPopCallbacks) {
callback.Invoke().then(v => result = !(bool)v);
if (result) {
return Future<RoutePopDisposition>.value(RoutePopDisposition.doNotPop).to<RoutePopDisposition>();
else {
base.willPop().Then((pop) => result.Resolve(pop));
}
};
fn(0);
return result;
}
return base.willPop();
// var callbacks = new List<WillPopCallback>(_willPopCallbacks);
// Promise<RoutePopDisposition> result = new Promise<RoutePopDisposition>();
// Action<int> fn = null;
// fn = (int index) => {
// if (index < callbacks.Count) {
// callbacks[index]().Then((pop) => {
// if (!pop) {
// result.Resolve(RoutePopDisposition.doNotPop);
// }
// else {
// fn(index + 1);
// }
// });
// }
// else {
// base.willPop().Then((pop) => result.Resolve(pop));
// }
// };
// fn(0);
// return result;
}
public void addScopedWillPopCallback(WillPopCallback callback) {

Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope(
key: _scopeKey,
route: this
// _ModalScope calls buildTransitions() and buildChild(), defined above
);
key: _scopeKey,
route: this
// _ModalScope calls buildTransitions() and buildChild(), defined above
);
}
public override ICollection<OverlayEntry> createOverlayEntries() {

}
public static class DialogUtils {
public static IPromise<object> showGeneralDialog(
public static Future<object> showGeneralDialog(
BuildContext context = null,
RoutePageBuilder pageBuilder = null,
bool barrierDismissible = false,

barrierColor: barrierColor,
transitionDuration: transitionDuration,
transitionBuilder: transitionBuilder
));
)).to<object>();
}
}

18
com.unity.uiwidgets/Runtime/widgets/scroll_activity.cs


using System;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;

);
_controller.addListener(_tick);
_controller.animateWith(simulation).Then(() => _end());
_controller.animateWith(simulation).then(o => _end());
}
public override float velocity {

D.assert(duration > TimeSpan.Zero);
D.assert(curve != null);
_completer = new Promise();
_completer = Completer.create();
_controller = AnimationController.unbounded(
value: from,
debugLabel: GetType().ToString(),

_controller.animateTo(to, duration: duration, curve: curve)
.Then(() => _end());
.then(o => _end());
readonly Promise _completer;
readonly Completer _completer;
public IPromise done {
get { return _completer; }
public Future done {
get { return _completer.future; }
}
public override float velocity {

}
public override void dispose() {
_completer.Resolve();
_completer.complete();
_controller.dispose();
base.dispose();
}

2
com.unity.uiwidgets/Runtime/widgets/scroll_context.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
namespace Unity.UIWidgets.widgets {
public interface ScrollContext {

8
com.unity.uiwidgets/Runtime/widgets/scroll_controller.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

}
public IPromise animateTo(float to,
public Future animateTo(float to,
List<IPromise> animations = CollectionUtils.CreateRepeatedList<IPromise>(null, _positions.Count);
List<Future> animations = CollectionUtils.CreateRepeatedList<Future>(null, _positions.Count);
return Promise.All(animations);
return Future.wait<object>(animations);
}
public void jumpTo(float value) {

12
com.unity.uiwidgets/Runtime/widgets/scroll_position.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {

activity.applyNewDimensions();
}
public IPromise ensureVisible(RenderObject renderObject,
public Future ensureVisible(RenderObject renderObject,
float alignment = 0.0f,
TimeSpan? duration = null,
Curve curve = null

minScrollExtent, maxScrollExtent);
if (target == pixels) {
return Promise.Resolved();
return Future.value();
return Promise.Resolved();
return Future.value();
}
curve = curve ?? Curves.ease;

public readonly ValueNotifier<bool> isScrollingNotifier = new ValueNotifier<bool>(false);
public override IPromise moveTo(float to, TimeSpan? duration, Curve curve = null, bool clamp = true) {
public override Future moveTo(float to, TimeSpan? duration, Curve curve = null, bool clamp = true) {
if (clamp) {
to = to.clamp(minScrollExtent, maxScrollExtent);
}

6
com.unity.uiwidgets/Runtime/widgets/scroll_position_with_single_context.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

didUpdateScrollDirection(value);
}
public override IPromise animateTo(float to,
public override Future animateTo(float to,
return Promise.Resolved();
return Future.value();
}
DrivenScrollActivity activity = new DrivenScrollActivity(

17
com.unity.uiwidgets/Runtime/widgets/scrollable.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RSG;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;
using UnityEngine;

return widget == null ? null : widget.scrollable;
}
public static IPromise ensureVisible(BuildContext context,
public static Future ensureVisible(BuildContext context,
float alignment = 0.0f,
TimeSpan? duration = null,
Curve curve = null

List<IPromise> futures = new List<IPromise>();
List<Future> futures = new List<Future>();
ScrollableState scrollable = of(context);
while (scrollable != null) {

}
if (futures.isEmpty() || duration == TimeSpan.Zero) {
return Promise.Resolved();
return Future.value();
}
if (futures.Count == 1) {

return Promise.All(futures);
return Future.wait<object>(futures);
}
}

controller.detach(oldPosition);
}
Window.instance.scheduleMicrotask(oldPosition.dispose);
async_.scheduleMicrotask(()=> {
oldPosition.dispose();
return null;
});
}
_position = controller == null

25
com.unity.uiwidgets/Runtime/widgets/selectable_text.cs


using System;
using System.Collections.Generic;
using RSG;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;

public void didChangeTextScaleFactor() {
}
public void didChangePlatformBrightness() {
}

public IPromise<bool> didPopRoute() {
return Promise<bool>.Resolved(false);
public Future<bool> didPopRoute() {
return Future<bool>.value(false).to<bool>();
public IPromise<bool> didPushRoute(string route) {
return Promise<bool>.Resolved(false);
public Future<bool> didPushRoute(string route) {
return Future<bool>.value(false).to<bool>();
}
void _handleTapDown(TapDownDetails details) {

}
_lastTapOffset = details.globalPosition;
_doubleTapTimer = Window.instance.run(Constants.kDoubleTapTimeout, _doubleTapTimeout);
_doubleTapTimer = Timer.create(Constants.kDoubleTapTimeout, _doubleTapTimeout);
}
_isDoubleTap = false;

void _handleDragUpdate(DragUpdateDetails details) {
_lastDragUpdateDetails = details;
_dragUpdateThrottleTimer = _dragUpdateThrottleTimer ??
Window.instance.run(TextSelectionUtils._kDragSelectionUpdateThrottle,
_handleDragUpdateThrottled);
Timer.create(TextSelectionUtils._kDragSelectionUpdateThrottle,
_handleDragUpdateThrottled);
void _handleDragUpdateThrottled() {
object _handleDragUpdateThrottled() {
D.assert(_lastDragStartDetails != null);
D.assert(_lastDragUpdateDetails != null);
if (widget.onDragSelectionUpdate != null) {

_dragUpdateThrottleTimer = null;
_lastDragUpdateDetails = null;
return null;
}
void _handleDragEnd(DragEndDetails details) {

}
}
void _doubleTapTimeout() {
object _doubleTapTimeout() {
return null;
}
bool _isWithinDoubleTapTolerance(Offset secondTapOffset) {

1
com.unity.uiwidgets/Runtime/widgets/text.cs


using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using StrutStyle = Unity.UIWidgets.painting.StrutStyle;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace Unity.UIWidgets.widgets {

24
com.unity.uiwidgets/Runtime/widgets/text_selection.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.scheduler2;
using TextRange = Unity.UIWidgets.ui.TextRange;
namespace Unity.UIWidgets.widgets {
static class TextSelectionUtils {

public void handlePaste(TextSelectionDelegate selectionDelegate) {
TextEditingValue value = selectionDelegate.textEditingValue; // Snapshot the input before using `await`.
Clipboard.getData(Clipboard.kTextPlain).Then((data) => {
Clipboard.getData(Clipboard.kTextPlain).then_((data) => {
if (data != null) {
selectionDelegate.textEditingValue = new TextEditingValue(
text: value.selection.textBefore(value.text)

offset: value.selection.start + data.text.Length
)
);
selectionDelegate.bringIntoView(selectionDelegate.textEditingValue.selection.extendPos);
selectionDelegate.hideToolbar();
}

void _handleDragStart(DragStartDetails details) {
_dragPosition = details.globalPosition +
new Offset(0.0f, -widget.selectionControls.handleSize.height);
new Offset(0.0f, -widget.selectionControls.handleSize.height);
}
void _handleDragUpdate(DragUpdateDetails details) {

}
_lastTapOffset = details.globalPosition;
_doubleTapTimer = Window.instance.run(Constants.kDoubleTapTimeout, _doubleTapTimeout);
_doubleTapTimer = Timer.create(Constants.kDoubleTapTimeout, _doubleTapTimeout);
}
_isDoubleTap = false;

void _handleDragUpdate(DragUpdateDetails details) {
_lastDragUpdateDetails = details;
_dragUpdateThrottleTimer = _dragUpdateThrottleTimer ??
Window.instance.run(TextSelectionUtils._kDragSelectionUpdateThrottle,
_handleDragUpdateThrottled);
_dragUpdateThrottleTimer =
_dragUpdateThrottleTimer ?? Timer.create(TextSelectionUtils._kDragSelectionUpdateThrottle, _handleDragUpdateThrottled);
void _handleDragUpdateThrottled() {
object _handleDragUpdateThrottled() {
D.assert(_lastDragStartDetails != null);
D.assert(_lastDragUpdateDetails != null);
if (widget.onDragSelectionUpdate != null) {

_dragUpdateThrottleTimer = null;
_lastDragUpdateDetails = null;
return null;
}
void _handleDragEnd(DragEndDetails details) {

_isDoubleTap = false;
}
void _doubleTapTimeout() {
object _doubleTapTimeout() {
return null;
}
bool _isWithinDoubleTapTolerance(Offset secondTapOffset) {

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存