Commit d2d11a04 authored by Hixie's avatar Hixie

Cleanup of SkyBinding, and resultant yak shaving.

Some files are moved by this:
  Copy framework/node.dart into types/ - preparing for framework/'s decomissioning.
  Move app/scheduler.dart into sky/scheduler.dart - "app" doesn't really make sense.

As part of the SkyBinding cleanup, I made the hit-testing less
RenderBox-specific, by having the HitTestEntry.target member be a
HitTestTarget, which is an interface with the handleEvent() function,
which is then implemented by RenderBox. In theory, someone could now
extend hit testing from the RenderBox world into their own tree of
nodes, and take part in all the same dispatch logic automatically.

This involved moving all the hit testing type definitions into a new
sky/hittest.dart file.

Renamed SkyBinding._app to SkyBinding._instance for clarity.

Moved code around in SkyBinding so that related things are together.

Made WidgetSkyBinding use the existing SkyBinding.instance singleton
logic rather than having its own copy.

I also added some stub README.md files that describe dependencies.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1187393002.
parent 5136d520
library sprites;
import 'dart:sky';
import 'dart:math' as Math;
import 'package:vector_math/vector_math.dart';
import 'dart:sky';
import 'dart:typed_data';
import 'package:sky/base/scheduler.dart' as scheduler;
import 'package:sky/mojo/net/image_cache.dart' as image_cache;
import 'package:sky/rendering/box.dart';
import 'package:sky/rendering/object.dart';
import 'package:sky/app/scheduler.dart' as scheduler;
import 'package:sky/framework/net/image_cache.dart' as image_cache;
import 'package:vector_math/vector_math.dart';
part 'sprite_box.dart';
part 'node.dart';
part 'node_with_size.dart';
part 'sprite.dart';
part 'image_map.dart';
\ No newline at end of file
part 'image_map.dart';
......@@ -5,7 +5,7 @@
import 'dart:sky' as sky;
import 'dart:math' as math;
import 'package:sky/app/scheduler.dart';
import 'package:sky/base/scheduler.dart';
import 'package:sky/rendering/box.dart';
import 'package:sky/rendering/flex.dart';
import 'package:sky/rendering/sky_binding.dart';
......
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:sky/rendering/sky_binding.dart';
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/navigator.dart';
import 'package:sky/widgets/widget.dart';
......@@ -35,8 +36,8 @@ class StocksApp extends App {
void main() {
print("starting stocks app!");
runApp(new StocksApp());
WidgetSkyBinding.skyBinding.onFrame = () {
SkyBinding.instance.onFrame = () {
// uncomment this for debugging:
// WidgetSkyBinding.skyBinding.debugDumpRenderTree();
// SkyBinding.instance.debugDumpRenderTree();
};
}
......@@ -6,6 +6,7 @@ import 'dart:math' as math;
import 'package:sky/rendering/box.dart';
import 'package:sky/rendering/flex.dart';
import 'package:sky/rendering/sky_binding.dart';
import 'package:sky/theme2/colors.dart';
import 'package:sky/theme2/edges.dart';
import 'package:sky/theme2/typography.dart';
......@@ -136,8 +137,8 @@ class SectorApp extends App {
void main() {
runApp(new SectorApp());
WidgetSkyBinding.skyBinding.onFrame = () {
SkyBinding.instance.onFrame = () {
// uncomment this for debugging:
// WidgetSkyBinding.skyBinding.debugDumpRenderTree();
// SkyBinding.instance.debugDumpRenderTree();
};
}
......@@ -4,9 +4,10 @@
import 'dart:sky' as sky;
import 'package:sky/app/scheduler.dart';
import 'package:sky/base/scheduler.dart';
import 'package:sky/rendering/box.dart';
import 'package:sky/rendering/flex.dart';
import 'package:sky/rendering/sky_binding.dart';
import 'package:sky/widgets/basic.dart';
import 'package:sky/widgets/raised_button.dart';
import 'package:sky/widgets/widget.dart';
......@@ -94,6 +95,6 @@ void main() {
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child: transformBox);
WidgetSkyBinding.skyBinding.root = root;
SkyBinding.instance.root = root;
addPersistentFrameCallback(rotate);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment