浏览代码

update binding

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
b35a09d3
共有 5 个文件被更改,包括 56 次插入22 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs
  2. 7
      com.unity.uiwidgets/Runtime/gestures/mouse_tracking.cs
  3. 24
      com.unity.uiwidgets/Runtime/rendering/binding.cs
  4. 12
      com.unity.uiwidgets/Runtime/rendering/view.cs
  5. 33
      com.unity.uiwidgets/Runtime/widgets/binding.cs

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs


style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w800)),
new Text("Counter: " + counter,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w900)),
new Text("Counter: " + counter,
new Text("Counter: " + counter + (char) 0xf472 + (char) 0xf442 + (char) 0xf43b,
style: new TextStyle(fontFamily: "robotox", fontSize: 18, fontWeight: FontWeight.w900,
fontStyle: FontStyle.italic)),
new Text("Counter: " + counter + (char) 0xf472 + (char) 0xf442 + (char) 0xf43b,

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


MouseDetectorAnnotationFinder annotationFinder,
bool inEditorWindow = false
) {
_router = router;
~MouseTracker() {
_router.removeGlobalRoute(_handleEvent);
}
readonly PointerRouter _router;
readonly bool inEditorWindow;

24
com.unity.uiwidgets/Runtime/rendering/binding.cs


set { PaintingBinding.instance = value; }
}
public RendererBinding(bool inEditorWindow = false) {
protected override void initInstances() {
base.initInstances();
instance = this;
// onSemanticsOwnerCreated: _handleSemanticsOwnerCreated,
// onSemanticsOwnerDisposed: _handleSemanticsOwnerDisposed,
// ..onSemanticsEnabledChanged = _handleSemanticsEnabledChanged
// ..onSemanticsAction = _handleSemanticsAction;
// _handleSemanticsEnabledChanged();
this.inEditorWindow = inEditorWindow;
_mouseTracker = _createMouseTracker();
initMouseTracker();
public void initRenderView() {
D.assert(renderView == null);
renderView = new RenderView(configuration: createViewConfiguration());

get { return _pipelineOwner; }
}
readonly PipelineOwner _pipelineOwner;
PipelineOwner _pipelineOwner;
public RenderView renderView {
get { return (RenderView) _pipelineOwner.rootNode; }

size: Window.instance.physicalSize / devicePixelRatio,
devicePixelRatio: devicePixelRatio
);
}
public void initMouseTracker(MouseTracker tracker = null) {
// _mouseTracker?.dispose();
_mouseTracker = tracker ?? new MouseTracker(pointerRouter, renderView.hitTestMouseTrackers);
}
void _handlePersistentFrameCallback(TimeSpan timeStamp) {

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


return true;
}
public MouseTrackerAnnotation hitTestMouseTrackers(Offset position) {
// Layer hit testing is done using device pixels, so we have to convert
// the logical coordinates of the event location back to device pixels
// here.
return layer.find<MouseTrackerAnnotation>(
position * configuration.devicePixelRatio
);
}
public override bool isRepaintBoundary {
get { return true; }
}

D.assert(() => {
if (D.debugRepaintRainbowEnabled || D.debugRepaintTextRainbowEnabled) {
D.debugCurrentRepaintColor = D.debugCurrentRepaintColor.withHue((D.debugCurrentRepaintColor.hue + 2.0f) % 360.0f);
D.debugCurrentRepaintColor =
D.debugCurrentRepaintColor.withHue((D.debugCurrentRepaintColor.hue + 2.0f) % 360.0f);
}
return true;

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


}
public static void runApp(Widget app) {
var instance = WidgetsFlutterBinding.ensureInitialized();
var instance = UiWidgetsBinding.ensureInitialized();
instance.scheduleAttachRootWidget(app);
instance.scheduleWarmUpFrame();
}

set { RendererBinding.instance = value; }
}
public WidgetsBinding(bool inEditorWindow = false) : base(inEditorWindow) {
protected override void initInstances() {
base.initInstances();
instance = this;
// D.assert(() => {
// _debugAddStackFilters();
// return true;
// }());
_buildOwner = new BuildOwner();
Window.instance.onLocaleChanged += handleLocaleChanged;
window.onLocaleChanged += handleLocaleChanged;
// addPersistentFrameCallback((duration) => {
// TextBlobMesh.tickNextFrame();
// TessellationGenerator.tickNextFrame();
// uiTessellationGenerator.tickNextFrame();
// uiPathCacheManager.tickNextFrame();
// });
// window.onAccessibilityFeaturesChanged = handleAccessibilityFeaturesChanged;
// SystemChannels.navigation.setMethodCallHandler(_handleNavigationInvocation);
// FlutterErrorDetails.propertiesTransformers.add(transformDebugCreator);
}
public BuildOwner buildOwner {

readonly BuildOwner _buildOwner = new BuildOwner();
BuildOwner _buildOwner = new BuildOwner();
public FocusManager focusManager {
get { return _buildOwner.focusManager; }

_handlePopRouteSub(false);
}
public readonly WidgetInspectorService widgetInspectorService;
public WidgetInspectorService widgetInspectorService;
protected override void handleMetricsChanged() {
base.handleMetricsChanged();

}
}
public class WidgetsFlutterBinding : WidgetsBinding {
public class UiWidgetsBinding : WidgetsBinding {
new WidgetsFlutterBinding();
new UiWidgetsBinding();
return WidgetsBinding.instance;
}
}
正在加载...
取消
保存