|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using Unity.UIWidgets.foundation; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using UnityEngine; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.rendering { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class RenderObjectWithChildMixinRenderSliver<ChildType> : RenderSliver, RenderObjectWithChildMixin<ChildType>, RenderObjectWithChildMixin where ChildType : RenderObject { |
|
|
|
public bool debugValidateChild(RenderObject child) { |
|
|
|
public virtual bool debugValidateChild(RenderObject child) { |
|
|
|
D.assert(() => { |
|
|
|
if (!(child is ChildType)) { |
|
|
|
throw new UIWidgetsError( |
|
|
|
|
|
|
|
|
|
|
public ChildType nextSibling { get; set; } |
|
|
|
|
|
|
|
public void detach() { |
|
|
|
public override void detach() { |
|
|
|
base.detach(); |
|
|
|
|
|
|
|
D.assert(previousSibling == null); |
|
|
|
D.assert(nextSibling == null); |
|
|
|
|
|
|
get { return _childCount; } |
|
|
|
} |
|
|
|
|
|
|
|
public override bool debugValidateChild(RenderObject child) { |
|
|
|
public bool debugValidateChild(RenderObject child) { |
|
|
|
D.assert(() => { |
|
|
|
if (!(child is ChildType)) { |
|
|
|
throw new UIWidgetsError( |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public abstract class RenderConstrainedLayoutBuilderMixinRenderObject<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderObject<ChildType>, |
|
|
|
RenderConstrainedLayoutBuilder<ConstraintType, ChildType> |
|
|
|
where ConstraintType : Constraints |
|
|
|
where ChildType : RenderObject { |
|
|
|
|
|
|
|
public LayoutCallback<ConstraintType> _callback { get; set; } |
|
|
|
public void updateCallback(LayoutCallback<ConstraintType> value) { |
|
|
|
if (value == _callback) |
|
|
|
return; |
|
|
|
_callback = value; |
|
|
|
markNeedsLayout(); |
|
|
|
} |
|
|
|
|
|
|
|
public void layoutAndBuildChild() { |
|
|
|
D.assert(_callback != null); |
|
|
|
invokeLayoutCallback(_callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class RenderConstrainedLayoutBuilderMixinRenderBox<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderBox<ChildType>, |
|
|
|
RenderConstrainedLayoutBuilder<ConstraintType, ChildType> |
|
|
|
where ConstraintType : BoxConstraints |
|
|
|
where ChildType : RenderBox { |
|
|
|
|
|
|
|
public LayoutCallback<ConstraintType> _callback { get; set; } |
|
|
|
public void updateCallback(LayoutCallback<ConstraintType> value) { |
|
|
|
if (value == _callback) |
|
|
|
return; |
|
|
|
_callback = value; |
|
|
|
markNeedsLayout(); |
|
|
|
} |
|
|
|
|
|
|
|
public void layoutAndBuildChild() { |
|
|
|
D.assert(_callback != null); |
|
|
|
invokeLayoutCallback(_callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public abstract class RenderConstrainedLayoutBuilderMixinRenderSliver<ConstraintType, ChildType> : RenderObjectWithChildMixinRenderSliver<ChildType>, |
|
|
|
RenderConstrainedLayoutBuilder<ConstraintType, ChildType> |
|
|
|
where ConstraintType : SliverConstraints |
|
|
|
where ChildType : RenderSliver { |
|
|
|
|
|
|
|
public LayoutCallback<ConstraintType> _callback { get; set; } |
|
|
|
public void updateCallback(LayoutCallback<ConstraintType> value) { |
|
|
|
if (value == _callback) |
|
|
|
return; |
|
|
|
_callback = value; |
|
|
|
markNeedsLayout(); |
|
|
|
} |
|
|
|
|
|
|
|
public void layoutAndBuildChild() { |
|
|
|
D.assert(_callback != null); |
|
|
|
invokeLayoutCallback(_callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |