because we don't want the lowered state property to look like we set a property on it.
Also do the ensure_window before because it need to be done before to be assigned
the default color
Besides `is_global()` add `is_root_component` to Rc<Component>, so that
we can distinguish between the main component (that should have the full
API, etc.) and supplementary components.
This also avoids the generation of unnecessary members when inlining is
disabled.
Remove the roots vector again, with selective inlining it's better
to use the "live" data structures instead of a copy of the roots.
It would be nice to centralize that into a helper function that returns
say an `Ref<'_, impl Iterator<Item = &Rc<Component>>>>` but that's not
possible yet.
The same chained iterator pattern is also used in some passes already.
Make sure that doc.root_component.used_types.structs has all the
structs, instead of storing them in used_types for each sub-component.
That should also account for the same structures used by different
components.
The generation is still incomplete, but this change passes them to the C++ generator
when not inlining.
Another option would've been a "inline: bool", but that won't suffice in
the future when we may want to use heuristics to selectively inline some
and others not. And always taking used_types.sub_components is wrong
when inlining as those are ... inlined.
`SIXTYFPS_DISABLE_INLINING=true` will do that and subsequently apply all the optimizations passes
on all components instead of just the root.
In the future we'll flip this around make make inlining opt-in, instead
of opt-out.
Revert part of the previous commit that tries to do all the pass without inlining
Fixup the few first passes so they work without inlining, but still do a full
inlining for most passes
The goal is to make it work pass by pass until we can have everything without
requiring full inlining
This is a two-stage change, that first centralizes the file I/O code
path for on-disk and builtin:/ files. Secondly the resource embedding
pass now produces diagnostics if a file cannot be located.
The synthetic window we "inject" in the ensure_window() pass did not
have the window-background from the style applied. This is visible
for example when viewing something like
Rectangle { background: blue; border-radius: height / 2 }
When exporting an global multiple times under different names, make sure
that they alias in the generated code.
As a consequence, the compiler maintains the original unique name and in
Rust and C++ makes only the exported names public. In the interpreter
the internal name is theoretically still accessible from the outside.
And do some passes before inlining
We will need the list of components before inlining in order to generate
them if we disable inlining
So we can do some passes on each component before they are inlining
I tried to put the flickable pass in that list, but it did not work
if the Flickable itself is the root of a component