Olivier Goffart
66887dda4c
Attempt to fix the compiler on windows
...
I believe there are raw \r in window that prevent the matching from working proprely
2020-11-04 19:29:50 +01:00
Simon Hausmann
68c411e860
Typo fix
2020-11-04 17:39:36 +01:00
Olivier Goffart
f940292182
Rename the builtinf file
2020-11-04 17:11:29 +01:00
Olivier Goffart
281a744e86
Load the builtin from a fake .60 file
2020-11-04 16:56:35 +01:00
Simon Hausmann
9df18a3747
Apply default layout spacing and padding from the style
...
Extract the StyleMetrics from the style and pass it to the layout
lowering pass for application.
The tests were adjusted to explicitly specify the padding/spacing to
override the ugly style default.
2020-11-04 15:20:43 +01:00
Simon Hausmann
e3c4e06ae9
Add an import_type helper function to TypeLoader
...
To be used soon.
2020-11-04 14:20:43 +01:00
Simon Hausmann
ef18e89e4f
Typeloader cleanup
...
Split the document loading related part of load_dependency into a
separate ensure_document helper function.
2020-11-04 14:16:58 +01:00
Simon Hausmann
01be063299
Typeloader cleanup
...
The all_documents member does not have to be externally provided, as
long as we keep the typeloader in scope instead. Since we'll later pass
it down to the layout lowering pass, that's fine.
2020-11-04 14:16:34 +01:00
Olivier Goffart
c1380875a9
Small code simplifications
2020-11-03 19:20:39 +01:00
Olivier Goffart
183f300a85
Implement the temperature converter in the .60 code
...
A edited signal was required on the line edit
2020-11-03 18:23:37 +01:00
Olivier Goffart
8a95b806c7
Strawman implementation of a combo box
2020-11-03 17:55:49 +01:00
Olivier Goffart
11e55dd8d2
String -> Float conversions
2020-11-03 15:19:58 +01:00
Simon Hausmann
3d7b69ecad
Type loader cleanup
...
Move the entire file import handling into a separte helper function. That makes collect_dependencies() easier to read.
2020-11-03 14:49:54 +01:00
Simon Hausmann
43052dec42
Another typeloader cleanup
...
Use the same future interface with an std::io::Result in the
CompilerConfiguration for the fallback loading.
2020-11-03 13:54:09 +01:00
Simon Hausmann
2c7b44c08b
Minor type loader cleanup
...
Begin unifying the interface between the file loading and the fallback
through the compiler config by also using a future in the file loading.
2020-11-03 13:50:36 +01:00
Olivier Goffart
e5302e0b7b
Remove unused Type::EnumerationValue
...
Values are not their own types
2020-11-03 12:34:17 +01:00
Olivier Goffart
4a182ef4d0
Layout alignment
2020-11-03 12:22:34 +01:00
Olivier Goffart
661982e747
Fix bindings on animation duration
2020-11-02 21:15:22 +01:00
Olivier Goffart
59707f068c
add a enabled property on the line edit
2020-11-02 18:20:01 +01:00
Simon Hausmann
cb8e1f54cd
Avoid fetching a multiply-imported document in the online editor
...
Instead of storing a Box<dyn Read> to lazily read the source if needed,
store a future instead that produces the string. That way we can delay
awaiting on the future that calls fetch() and skip it if possible.
2020-11-02 17:25:28 +01:00
Olivier Goffart
72f22c8aad
Make a StyleMetrics global in the style and use it from todo just to test
2020-11-02 17:19:57 +01:00
Olivier Goffart
decbe0ade5
Fix panic when exporting invalid types
...
And also still allow to export builtin component
2020-11-02 17:18:42 +01:00
Simon Hausmann
f28d6f88c2
Don't read a file multiple times when importing it multiple times
...
Delay the reading bit from the file system until we have a cache miss in
all_documents.
2020-11-02 16:47:15 +01:00
Olivier Goffart
a82c23fc41
Add ability for the native style to export native Globals
2020-11-02 16:13:04 +01:00
Simon Hausmann
94265cb9e6
Clean up typeloader a bit
...
Move the many duplicated parameters into a shared TypeLoader structure
2020-11-02 15:58:53 +01:00
Simon Hausmann
6890e6a45f
Fix failing callback load test
...
If there's no path resolution callback specified, use the given path.
2020-11-02 15:13:40 +01:00
Simon Hausmann
d435a7c8b8
Fix loading of images from imported files in the online editor
...
We need to separate the url resolution step from the document fetching,
as we need to keep the loaded url in Rust for further
resolution.
2020-11-02 14:57:49 +01:00
Olivier Goffart
232d59bf24
Ensure that the repeater are updated when layouting box layout
2020-11-02 11:37:04 +01:00
Olivier Goffart
1eb7203ec8
Also do the comperty comparison in C++
2020-10-31 14:36:38 +01:00
Olivier Goffart
2ece3817cc
Make ModelHandle a struct
...
Last commit broke for structures containing models, because models are not PartialEq.
So we need to implement PartialEq for ModelHandle. Which means a struct needs to
be created
2020-10-31 13:32:19 +01:00
Olivier Goffart
d2255327fe
Properties: make sure that the falue is different before marking all dependencies dirty
...
Fix the animation of the gauge in the printer demo
2020-10-31 12:58:11 +01:00
Olivier Goffart
ab14978fa8
Support for
in box layout in the C++ backtend
2020-10-31 09:10:16 +01:00
Olivier Goffart
d339ead5dd
support for
within box layouts
...
Only rust implementation for now
2020-10-30 19:12:48 +01:00
Simon Hausmann
c3ba5a0808
Clean up NativeButton
...
Eliminate native_button_enabled
2020-10-30 16:28:06 +01:00
Simon Hausmann
6b7630963f
Add support for disabling a Button
...
This also removes the funny binding on the button in the gallery.
UI wise it's confusing that a button changes its size when pressed, and we can
show off bindings somewhere else :-)
2020-10-30 15:55:18 +01:00
Olivier Goffart
ea5e140d00
Add a callback to load the import files if they are not on the file system
2020-10-30 15:09:24 +01:00
Olivier Goffart
359f42c5f7
Prepare the compiler to be async
...
This will allow the online editor to load imports from URL asynchroniously later
Since currently the compiler is only working on a single thread, and that we
never await on a future that could block, it is allowed to use the spin_on executor
2020-10-30 15:00:04 +01:00
Olivier Goffart
2d55b2a51a
Don't load document twice if they are imported twice
...
Also protect against cyclic imports
2020-10-30 10:14:27 +01:00
Olivier Goffart
a4b476bdf3
implement Component::layout_info in C++
2020-10-29 19:08:52 +01:00
Olivier Goffart
98e4dbbc4d
Implement layout info for the component in rust.rs
2020-10-29 19:08:52 +01:00
Olivier Goffart
f855b18fb0
Implement min/max size restriction on the window
...
(Implemented in the interpreter only for now)
2020-10-29 19:08:52 +01:00
Olivier Goffart
5face45c51
Rename Component::compute_layout to apply_layout
...
And pass the expected rectangle.
This is currently not used yet but will be needed when we can have
repeated elements within a box layout
2020-10-29 19:08:52 +01:00
Simon Hausmann
cba020182a
Remove unused parameter
2020-10-29 14:03:15 +01:00
Simon Hausmann
e9bb668921
Replace errors with panics in the export processing
...
The errors here are not subject to regular test coverage because their
occurrence indicates a grave internal error. There should not be valid
input syntax that leads to this code path.
2020-10-29 14:00:52 +01:00
Simon Hausmann
9c3cfae105
Remove indexmap again in favor of BTreeMap for import processing
2020-10-29 13:28:57 +01:00
Simon Hausmann
ed714bd332
Fix type leak across imports
...
Given the test case
import { SomeType } from "somewhere.60";
import { Blah } from "foo.60";
and foo.60 trying to use "SomeType":
export Blah := SomeType {}
then the lookup for "SomeType" in foo.60 should fail. Instead it leaked
through the populated type registry when processing the dependencies for
the outer file.
This is fixed by ensuring that the type registry for a file only has the
global type registry as parent. To ensure that the test reliably covers
this, the import dependencies are now processed in declaration order
(hence the switch to IndexMap that preserves insertion order).
2020-10-29 12:55:00 +01:00
Simon Hausmann
14ad99fed4
Add support for checking diagnostics in imported files
2020-10-29 12:51:36 +01:00
Olivier Goffart
8aa1c5ae1b
remove debugging code
2020-10-29 11:59:25 +01:00
Olivier Goffart
0b169b564a
Use a global palette in the ugly style
2020-10-29 11:01:04 +01:00
Olivier Goffart
6d440eb7e3
Fix using global in imported files
...
This required doing the type resolving for the export with all
component in the export
2020-10-29 11:01:04 +01:00