浏览代码

girds

/main
siyao 3 年前
当前提交
2cb4e56f
共有 20 个文件被更改,包括 355 次插入19 次删除
  1. 2
      com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs
  2. 2
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  3. 16
      com.unity.uiwidgets/Runtime/external/SplayTree.cs
  4. 2
      com.unity.uiwidgets/Runtime/material/chip.cs
  5. 2
      com.unity.uiwidgets/Runtime/material/input_decorator.cs
  6. 2
      com.unity.uiwidgets/Runtime/material/list_tile.cs
  7. 2
      com.unity.uiwidgets/Runtime/widgets/binding.cs
  8. 12
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  9. 2
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  10. 2
      com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs
  11. 2
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  12. 2
      com.unity.uiwidgets/Runtime/widgets/sliver_persistent_header.cs
  13. 2
      com.unity.uiwidgets/Runtime/widgets/table.cs
  14. 18
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.cs
  15. 3
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.cs.meta
  16. 143
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.gen.cs
  17. 11
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.gen.cs.meta
  18. 146
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.njk
  19. 3
      com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.njk.meta

2
com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs


_AlertSections.actionsSection);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

2
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


_AlertDialogSections.actionsSection);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

16
com.unity.uiwidgets/Runtime/external/SplayTree.cs


using System.Collections.Generic;
using System.Linq;
namespace Unity.UIWidgets.external {
class SplayTree<TKey, TValue> : IDictionary<TKey, TValue> where TKey : IComparable<TKey> {
namespace Unity.UIWidgets.external {
public class SplayTree<TKey, TValue> : IDictionary<TKey, TValue> where TKey : IComparable<TKey> {
SplayTreeNode root;
int count;
int version = 0;

node = node.RightChild;
}
return node.Key;
}
public TKey firstKey() {
if (root == null) return default; // TODO: this is suppose to be null
var first = First().Value;
return first.Key;
}
public TKey lastKey() {
if (root == null) return default; // TODO: this is suppose to be null
var last = Last().Value;
return last.Key;
}
public TKey firstKeyAfter(TKey key) {

2
com.unity.uiwidgets/Runtime/material/chip.cs


slotToChild.Values.Each((value) => { visitor(value); });
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.ContainsValue(child));
D.assert(childToSlot.ContainsKey(child));
_ChipSlot slot = childToSlot[child];

2
com.unity.uiwidgets/Runtime/material/input_decorator.cs


slotToChild.Values.Each((child) => { visitor(child); });
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.ContainsValue(child));
D.assert(childToSlot.ContainsKey(child));
_DecorationSlot slot = childToSlot[child];

2
com.unity.uiwidgets/Runtime/material/list_tile.cs


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.Values.Contains(child));
D.assert(childToSlot.Keys.Contains(child));
_ListTileSlot slot = childToSlot[child];

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

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


HashSet<Element> _debugForgottenChildrenWithGlobalKey = new HashSet<Element>();
internal virtual void forgetChild(Element child) {
public virtual void forgetChild(Element child) {
D.assert(() => {
if (child.widget.key is GlobalKey)
_debugForgottenChildrenWithGlobalKey.Add(child);

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

protected RenderObjectElement(RenderObjectWidget widget) : base(widget) {
}
public new RenderObjectWidget widget {
public new virtual RenderObjectWidget widget {
get { return (RenderObjectWidget) base.widget; }
}

public LeafRenderObjectElement(LeafRenderObjectWidget widget) : base(widget) {
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(false);
base.forgetChild(child);
}

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(_children.Contains(child));
D.assert(!_forgottenChildren.Contains(child));
_forgottenChildren.Add(child);

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


visitor(_child);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
_childElements.Remove((int) (child.slot));
base.forgetChild(child);
}

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


}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child != null);
D.assert(child.slot != null);
D.assert(_childElements.ContainsKey((int) child.slot));

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


});
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == this.child);
this.child = null;
base.forgetChild(child);

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
_forgottenChildren.Add(child);
}
}

18
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
public interface TileContainerRenderObjectMixin<ChildType, ParentDataType> {
void forEachChild(Action<ChildType> f);
void remove(int index);
void _removeChild(ChildType child);
void removeAll();
// void detach();
// void attach(object owner);
// void redepthChildren();
// void visitChildren(RenderObjectVisitor visitor);
// List<DiagnosticsNode> debugDescribeChildren();
}

3
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.cs.meta


fileFormatVersion: 2
guid: 3af8956ed28744b899a62e3b21778d83
timeCreated: 1626685582

143
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.gen.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.external;
public abstract class TileContainerRenderObjectMixinRenderSliver<ChildType, ParentDataType>: RenderSliver, TileContainerRenderObjectMixin<ChildType, ParentDataType>
where ChildType : RenderObject
where ParentDataType : ParentData
{
// need to make SplayTree public
SplayTree<int, ChildType> _childRenderObjects = new SplayTree<int, ChildType>();
/// The number of children.
protected int childCount
{
get => _childRenderObjects.Count;
}
protected ICollection<ChildType> children
{
get => _childRenderObjects.Values;
}
protected ICollection<int> indices
{
get => _childRenderObjects.Keys;
}
/// Checks whether the given render object has the correct [runtimeType] to be
/// a child of this render object.
///
/// Does nothing if assertions are disabled.
///
/// Always returns true.
public bool debugValidateChild(RenderObject child)
{
D.assert(() =>
{
if (child is ChildType)
{
throw new UIWidgetsError(
"A $runtimeType expected a child of type $ChildType but received a " +
"child of type ${child.runtimeType}.\n" +
"RenderObjects expect specific types of children because they " +
"coordinate with their children during layout and paint. For " +
"example, a RenderSliver cannot be the child of a RenderBox because " +
"a RenderSliver does not understand the RenderBox layout protocol.\n" +
"\n" +
"The $runtimeType that expected a $ChildType child was created by:\n" +
" $debugCreator\n" +
"\n" +
"The ${child.runtimeType} that did not match the expected child type " +
"was created by:\n" +
" ${child.debugCreator}\n");
}
return true;
});
return true;
}
public ChildType this[int index]
{
get => _childRenderObjects[index];
set
{
if (index < 0)
{
throw new ArgumentException($"index {index}");
}
_removeChild(_childRenderObjects[index]);
adoptChild(value);
_childRenderObjects[index] = value;
}
}
public virtual void forEachChild(Action<ChildType> f)
{
_childRenderObjects.Values.ToList().ForEach(f);
}
/// Remove the child at the specified index from the child list.
public virtual void remove(int index)
{
var child = _childRenderObjects[index];
_childRenderObjects.Remove(index);
_removeChild(child);
}
public virtual void _removeChild(ChildType child)
{
if (child != null)
{
// Remove the old child.
dropChild(child);
}
}
/// Remove all their children from this render object's child list.
///
/// More efficient than removing them individually.
public virtual void removeAll()
{
_childRenderObjects.Values.ToList().ForEach(dropChild);
_childRenderObjects.Clear();
}
public override void attach(object owner)
{
// base.attach(owner);
_childRenderObjects.Values.ToList().ForEach((child) => child.attach(owner));
}
public override void detach()
{
// base.detach();
_childRenderObjects.Values.ToList().ForEach((child) => child.detach());
}
public override void redepthChildren()
{
_childRenderObjects.Values.ToList().ForEach(redepthChild);
}
public override void visitChildren(RenderObjectVisitor visitor)
{
_childRenderObjects.Values.ToList().ForEach(r => visitor(r));
}
public override List<DiagnosticsNode> debugDescribeChildren()
{
List<DiagnosticsNode> children = new List<DiagnosticsNode>();
_childRenderObjects.ToList().ForEach(pair =>
children.Add(pair.Value.toDiagnosticsNode(name: $"child {pair.Key}")));
return children;
}
}

11
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.gen.cs.meta


fileFormatVersion: 2
guid: 146276dca5447c54db1111667c732027
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

146
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.njk


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.external;
{% macro TileContainerRenderObjectMixin(with) %}
public abstract class TileContainerRenderObjectMixin{{with}}<ChildType, ParentDataType>: {{with}}, TileContainerRenderObjectMixin<ChildType, ParentDataType>
where ChildType : RenderObject
where ParentDataType : ParentData
{
// need to make SplayTree public
SplayTree<int, ChildType> _childRenderObjects = new SplayTree<int, ChildType>();
/// The number of children.
private int childCount
{
get => _childRenderObjects.Count;
}
ICollection<ChildType> children
{
get => _childRenderObjects.Values;
}
ICollection<int> indices
{
get => _childRenderObjects.Keys;
}
/// Checks whether the given render object has the correct [runtimeType] to be
/// a child of this render object.
///
/// Does nothing if assertions are disabled.
///
/// Always returns true.
public bool debugValidateChild(RenderObject child)
{
D.assert(() =>
{
if (child is ChildType)
{
throw new UIWidgetsError(
"A $runtimeType expected a child of type $ChildType but received a " +
"child of type ${child.runtimeType}.\n" +
"RenderObjects expect specific types of children because they " +
"coordinate with their children during layout and paint. For " +
"example, a RenderSliver cannot be the child of a RenderBox because " +
"a RenderSliver does not understand the RenderBox layout protocol.\n" +
"\n" +
"The $runtimeType that expected a $ChildType child was created by:\n" +
" $debugCreator\n" +
"\n" +
"The ${child.runtimeType} that did not match the expected child type " +
"was created by:\n" +
" ${child.debugCreator}\n");
}
return true;
});
return true;
}
public ChildType this[int index]
{
get => _childRenderObjects[index];
set
{
if (index < 0)
{
throw new ArgumentException($"index {index}");
}
_removeChild(_childRenderObjects[index]);
adoptChild(value);
_childRenderObjects[index] = value;
}
}
public virtual void forEachChild(Action<ChildType> f)
{
_childRenderObjects.Values.ToList().ForEach(f);
}
/// Remove the child at the specified index from the child list.
public virtual void remove(int index)
{
var child = _childRenderObjects[index];
_childRenderObjects.Remove(index);
_removeChild(child);
}
public virtual void _removeChild(ChildType child)
{
if (child != null)
{
// Remove the old child.
dropChild(child);
}
}
/// Remove all their children from this render object's child list.
///
/// More efficient than removing them individually.
public virtual void removeAll()
{
_childRenderObjects.Values.ToList().ForEach(dropChild);
_childRenderObjects.Clear();
}
public override void attach(object owner)
{
// base.attach(owner);
_childRenderObjects.Values.ToList().ForEach((child) => child.attach(owner));
}
public override void detach()
{
// base.detach();
_childRenderObjects.Values.ToList().ForEach((child) => child.detach());
}
public override void redepthChildren()
{
_childRenderObjects.Values.ToList().ForEach(redepthChild);
}
public override void visitChildren(RenderObjectVisitor visitor)
{
_childRenderObjects.Values.ToList().ForEach(r => visitor(r));
}
public override List<DiagnosticsNode> debugDescribeChildren()
{
List<DiagnosticsNode> children = new List<DiagnosticsNode>();
_childRenderObjects.ToList().ForEach(pair =>
children.Add(pair.Value.toDiagnosticsNode(name: $"child {pair.Key}")));
return children;
}
}
{% endmacro %}
{{ TileContainerRenderObjectMixin('RenderSliver') }}

3
com.unity.uiwidgets/Runtime/codegen/TileContainerRenderObjectMixin.mixin.njk.meta


fileFormatVersion: 2
guid: cdbbb536a55f4d5da396f06ce06aa5b8
timeCreated: 1626681945
正在加载...
取消
保存