Commit graph

78 commits

Author SHA1 Message Date
Olivier Goffart
76ca2eed6b Fix intra-doc links
It should be ``[`...`]``, not `` `[...]` ``
2021-08-19 09:17:30 +02:00
Tobias Hunger
dc51d4ccda Use impl Default instead of new() constructors 2021-07-12 13:22:25 +02:00
Olivier Goffart
13bd828b96 Update license date 2021-07-02 15:55:54 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
3fb0e80848 Test for the crash of the preview when reloading 2021-05-31 18:48:03 +02:00
Olivier Goffart
21a80f4562 WIP: Layout refactoring
Instead of using a solve_layout function in the component, use property to hold
a layout cache.

This commit only implement the GridLayout and only the interpreter part
2021-05-11 14:59:57 +02:00
Simon Hausmann
140de87351 Add a brief overview section to the C++ interpreter namespace
This mirrors the Rust module side.

Unfortunately the code examples aren't rendered correctly :(
2021-04-27 13:02:41 +02:00
Simon Hausmann
afe3df6381 Remove the public API for registering fonts by path or memory chunk
This is not needed anymore in the light of being able to write `import "blah.ttf"` in .60 markup
2021-04-14 10:01:33 +02:00
Simon Hausmann
6efc594cf9 Fix doc tests 2021-03-19 17:54:05 +01:00
Simon Hausmann
4705c455b9 Remove CompilerConfiguration from the interpreter API
It's not needed anymore with `ComponentCompiler` (I forgot to remove it)
2021-03-19 17:02:19 +01:00
Simon Hausmann
de8ad46633 Fix doc warnings 2021-03-18 18:31:42 +01:00
Simon Hausmann
4a9cd954b8 Rework the Rust entry point API for the interpreter
Switch to the stateful `ComponentCompiler` concept that we discussed for the C++ API.
2021-03-18 18:20:50 +01:00
Olivier Goffart
6e9d4f9e8d Fix linking of the interpreter
I don't know why, byt the 'crate-type = "lib"' seem to fix the problem
2021-03-17 12:38:05 +01:00
Simon Hausmann
cf2b02c9fa Add the initial C++ header file for the interpreter with the start of Value 2021-03-17 12:10:12 +01:00
Olivier Goffart
6315b02ffe Build the documentation with all features 2021-03-16 12:04:40 +01:00
Olivier Goffart
455693dbc0 Documentation for the interpreter crate 2021-03-16 11:24:02 +01:00
Olivier Goffart
48333370a6 Use the new interpreter API in things that depends on it 2021-03-15 17:29:27 +01:00
Simon Hausmann
9034bd3d1a Move the refined eval::Value API to api::Value
This is the new public value representation for the interpreter
2021-03-15 15:12:34 +01:00
Simon Hausmann
c2c3e00cd7 Remove ModelPtr from the interpreter
Instead stick a straight `Rc<dyn ...>` into the `Value` enum
2021-03-15 14:43:01 +01:00
Simon Hausmann
2ae5b8413a Fix wasm build
Re-add the compiler configuration internal API. When `from_string` is complete then we can switch to the new public
compiler config API.

And use diagnostics accessor functions.
2021-03-15 11:25:48 +01:00
Simon Hausmann
fdeca052cb Provide the same CompilerConfiguration wrapper in the interpreter API as in the Rust build API 2021-03-15 10:05:56 +01:00
Olivier Goffart
7584b571ea Interpreter: refactor in preparation to expose a public API 2021-03-10 09:08:25 +01:00
Olivier Goffart
6154736910 Some work toward a public interpreter API 2021-03-09 19:31:29 +01:00
Simon Hausmann
3ba92bdc6d Add API to the wasm interpreter to download and register fonts 2021-02-17 15:21:30 +01:00
Simon Hausmann
445ddd58d5 API cleanup
Remove the `application` infix from `register_application_font`, to
reduce the changes that it might be interpreted to be a function that
also changes the default font in all text elements.
2021-02-17 14:37:31 +01:00
Simon Hausmann
45fe6c3e8d Add the ability to load application fonts by path
The viewer command line tool also gains the ability to specify them via `--app-font=/path/to/font.ttf` , which can be specified multiple times.
2021-02-17 14:16:52 +01:00
Olivier Goffart
9eac131ae5 Add the logo in the docs 2021-02-12 08:24:42 +01:00
Olivier Goffart
5a21f1bd81 Rename emit_ to call_ for callback
Signal was renamed to Callback, but one does not emit a callback, one calls it
2021-01-25 15:59:10 +01:00
Simon Hausmann
5f265ffc09 Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.

As a bonus, the run() function on generated components is not consuming
anymore.
2021-01-19 09:50:22 +01:00
Olivier Goffart
0d2d48be4f Rename "signal" to "callback" 2020-12-18 09:51:01 +01:00
Simon Hausmann
6d427f5654 Fix the wasm interpreter build 2020-12-10 15:42:33 +01:00
Olivier Goffart
bff55d4f1b Return value for signal 2020-12-01 18:52:51 +01:00
Olivier Goffart
e73bbbcd10 More work on signal returning value 2020-12-01 18:47:49 +01:00
Olivier Goffart
3cd84473e2 Transitions in the interpreter 2020-11-20 12:32:43 +01:00
Simon Hausmann
b4ad5786d5 Simplify VRc handling in the interpreter
All call sites of dynamic_component::instantiate move the result into a VRc<ErasedComponentBox>,
so might as well do this in that function.

Also added a self_weak for future use.
2020-11-18 09:59:05 +01:00
Simon Hausmann
64b92df87e Initialize the component in the Window at component creation time
This will allow getting rid of the component as parameter to run()
2020-11-11 19:03:04 +01:00
Simon Hausmann
a9791c390d Wrap the main component in a VRc 2020-11-11 18:14:15 +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
1479bc956e Support for global in the interpreter 2020-10-29 11:01:04 +01:00
Olivier Goffart
27a6ff1227 Move Type and related concepts in a different module
Leaving only the TypeRegister in the typeregister module
2020-10-23 11:17:14 +02:00
Olivier Goffart
14198052ac ArrayModel support in JS 2020-10-17 13:33:22 +02:00
Olivier Goffart
d57ad389e0 Default to the native style in the viewer if it is available 2020-10-14 14:51:47 +02:00
Olivier Goffart
1f50e8c85e Highlight the error in the online editor 2020-10-06 11:33:44 +02:00
Olivier Goffart
518c4ccf3d ListView in the interpreter 2020-10-02 21:27:10 +02:00
Olivier Goffart
2314e59ab2 Refactor the repeater in the interpreter
Use the same Repeater as the rust backend
2020-10-02 21:26:47 +02:00
Olivier Goffart
0cb827a901 Two ways binding with optimized public property in the interpreter 2020-09-25 09:50:03 +02:00
Olivier Goffart
42aa91e3eb Support for signal with arguments in the interpreter 2020-09-09 11:27:58 +02:00
Olivier Goffart
e997dff094 Use a reference as a signal argument.
It will be easier to make that work with C++
2020-09-08 12:12:01 +02:00
Simon Hausmann
ff9c118e07 Propagate warnings to the end of the compilation step and print them 2020-09-04 20:34:20 +02:00
Olivier Goffart
f1ad78bc25 Qt style support for the rust backend
Need to set the SIXTYFPS_STYLE=native env variable while compiling
2020-09-01 12:25:11 +02:00