We can't have two copies of |embedder.dart| or |shell.dart| because they take
ownership of some underlying Mojo handles. Instead of duplicating the code,
this CL makes the old locations just export all the symbols from the new
location. I've also done the same with fetch.dart to avoid code duplication.
Finally, I've removed image_cache.dart in the old location because the only
clients already live in the new world and ought to use the new location.
TBR=ianh@google.com
Review URL: https://codereview.chromium.org/1179923004.
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.
Move app/view.dart to rendering/sky_binding.dart since it's part of the RenderObject API, really (it knows about RenderView intimately).
The tests pass. I didn't check every last example.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1183913006.
Buttons and menu items use onPressed. Also, don't pass along the sky.Event
because that's a lower-level concept.
I've also reordered parameter lists to put the |child| argument last in a
number of places.
Also, fixed a bug where FloatingActionButton was missing syncFields.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1188993003.
This also moves the test for stocks into a new tests/examples/
directory, where we can put tests that test the examples.
TBR=abarth
Review URL: https://codereview.chromium.org/1182223004.
The underlying problem is that we lacked a RenderObjectWrapper for the
RenderView, which meant we couldn't handle changing the RenderObject that was
the root of the RenderView. This CL introduces a RenderViewWrapper and uses it
in a new AppContainer widget root. This change allows us to make App a
non-magical Component that is inserted into the AppContainer in the newly
introduced runApp function.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1184823006.
This is a completion of Eric's WIP patch:
https://codereview.chromium.org/1179663005/
Low level support for creating a paragraph that contains
runs of styled text. The styles may be nested.
The Paragraph and RenderParagraph classes have been
replaced by Inline and RenderInline. Styled text is defined
with a tree of InlineText and InlineStyle objects.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1177833012.
Sector changes:
- implement the intrinsic sizing box API on RenderBoxToRenderSectorAdapter
- remove some debug print statements
- fix getIntrinsicDimensions() on RenderSolidColor to return true values
- factor out the default demo
RenderObject changes:
- BoxConstraints.isInfinite() now returns true only if both dimensions are infinite
fn changes:
- implement UINodeToRenderBoxAdapter
- rename RenderObjectToUINodeAdapter to RenderBoxToUINodeAdapter
Tests:
- add a test for sector layout
- make TestRenderView support being run without the unit test framework
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1175423007.
Make old users of RenderSizedBox use RenderConstrainedBox.
Change the semantics of BoxDecoration.apply* to actually apply the provided constraints to the current constraints, rather than the previous behaviour of merging them neutrally.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1189603003.
Deletes old test game
Demo game is now playable
Updates demo game with steering and changes in sprites
Fixes smaller bugs in sprites
Refactor class names in game demo
Strips Box2D from game
Fixes ordering in game node
Adds frameRate property to SpriteBox and improves update methods.
Fixes node to box transformations for hit tests
Fixes minor code issues
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1179333002.
Make Material actually create material, with opinions about what that
means.
Make FloatingActionButton use this.
Make Scrollable use this.
Make BoxDecoration support drawing a circle instead of a rectangle, so
that floating action button doesn't need a custom painter.
Implement RaisedButton (and remove button.dart, since there's no
"button" in Material Design).
Make InkWell have a "child" argument instead of "children", and not
have it introduce a Flex into the hierarchy.
Update container.dart example. Clean up some imports.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1179713004.
I also removed the leading /, so it is now possible
to use shelldb start sky/sky_home to test.
Also fixed touch_demo.dart and sector layout to
work and not crash.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1177343002.
This moves input.dart to editing2/, since that way we can define the layering as strictly unidirectional.
It also reorders a bunch of imports to fit the style guide.
I removed the old remnants of the widgets example, and put the fn2 examples into the examples/widgets/ directory, to parallel the framework directory names.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1177243002.
Sprite nodes use Point instead of Vector2
Updates sprite test app
Refactors accounting for pivot points in sprites
Adds abstract NodeWithSize class in Sprites.
Refactors SpriteNode to Sprite
Refactors TransformNode to Node (may need to find another name as it conflicts with Sky's Node).
Sprite system now uses and caches transformation matrices.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1180703002.
Previously, they always started at the center of the RenderInkWell. Now we
remember the local coordinates we computed during the hit test and provide that
information when handling the event.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1180553002.
This also removes one bit of magic to make it more obvious what on is
going on during a sync, which should hopefully help.
Components have to decide if they support being stateful or not. If
they do, then they must implement syncFields() and have mutable
fields; if they don't, then they must have final fields. This isn't
particularly enforced, though.
This also renames _willSync() to _retainStatefulNodeIfPossible(), for
clarity, and fixes some minor style issues and one typo that was
breaking the drawer.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/1174023003
This CL replaces the (non-working) components2 InkWell with some code based on
the ink_well example. There are at least two issues with the implementation:
1) The ink splash always starts at the center of the well because we don't have
a facility for converting from global to local coordinates, which means we
can't tell where the tap occurred in the local coordinates we need to use
for painting.
2) When used inside a MenuItem, the in splash disappears shortly after
starting, presumably because the button starts highlighting, which causes a
component rebuild and somehow we lose the RenderInkWell instance.
I plan to address these issues in subsequent CLs.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1172033003.
StockRows are now a relatively simple application of flex layout.
The up/down arrows are now rendered within a circle, like
the original version. The arrows are a little bigger,
because.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1165223005.
We already know how to talk to the network_service from Dart
via fetch.dart. Might as well use that for Image loading
as well insetad of having ImageLoader do it.
As part of this I've renamed *ImageLoader to *ImageDecoder
and moved all the image loading logic into Dart. This required
me to teach the idl system about mojo handles so that I could
pass the resulting MojoHandle from fetch.dart up through to
ImageDecoder.
R=abarth@chromium.org, jackson@google.com, hansmuller@google.com
Review URL: https://codereview.chromium.org/1173703002.
This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1167293003
The popup menu is displayed in the wrong location with the wrong width, but it
does draw. I've also removed the checkbox because the flex container was
causing me trouble. I'll add it back in a later CL.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1166153002
This includes making SizedBox default to infinite size, and making
Container default to containing one infinite-sized SizedBox. That way,
you can use an empty Container as a spacer in a flex box.
The rendering doesn't quite work, because of a bug in flex whereby it
doesn't shrink-wrap its contents in the cross-direction, it fills the
parent. Collin is on that.
R=jackson@google.com
Review URL: https://codereview.chromium.org/1163633003
I had to complicate the IDL bindings generation to allow passing an array of
colors. Without these changes, we'd try to convert the dart object to
Vector<SkColor>, which C++ thinks is Vector<unsigned>, and we'd use the wrong
converter. So I added some template grease to force it to use a
Vector<CanvasColor> converter.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1152963009