Commit graph

51 commits

Author SHA1 Message Date
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
Olivier Goffart
80dd7dcb04 Allow to specify the canvas id when creating a new window with wasm 2020-08-26 17:01:17 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
d3a474af26 Move corelib::Component and friends back into their dedicated component module 2020-08-12 11:39:07 +02:00
Simon Hausmann
0df86d7eeb Move corelib::abi::datastructures::Component to corelib 2020-08-12 10:53:03 +02:00
Olivier Goffart
e013ea6c50 Refactor the interpreter by trying to use FieldOffset insdead of usize for offsets
Give a unique identifier lifetime to instance so that they cannot be mixed safely
2020-08-11 10:22:16 +02:00
Olivier Goffart
00c32e9c6d vtable: remove the convinient type alias from the macro
If one really need them, they can be implemented by the user
2020-08-03 11:03:24 +02:00
Olivier Goffart
05c5f7c53d Test and fix animations on properties
The animation should not start when the property is initialized, only when the
property is set by the setter
2020-07-23 11:45:34 +02:00
Olivier Goffart
e00491811b Get rid of the context in properties/signal 2020-07-13 18:49:06 +02:00
Simon Hausmann
4f2f27cbda Simplify property and binding setting code in the interpreter
Change the Property RTTI to take an optional animation, instead of
having to match on each call site.
2020-06-26 20:33:55 +02:00
Olivier Goffart
0029921f1a Pin the items in the interpreter 2020-06-26 11:55:05 +02:00
Simon Hausmann
c18861125d Small typo fix :-) 2020-06-25 14:22:10 +02:00
Olivier Goffart
caca0d0ba4 Put the component in a Pin<>
Removed the drop and create from the ComponentVTable:
since we are not using VBox<ComponentVTable>, this simplifies a bit
the code of the interpreter and everything else.

But there is still a lot of changes everywhere to support that the Component
is pinned.
This is just for the component. Which would be required if later we want
to access the properties as Pin<Property<_>>. But we have not yet ability
to do projections
2020-06-24 14:13:27 +02:00
Olivier Goffart
f8b7989c0b Access the properties in the parent component of a repeated element
This required some refactoring of the EvaluationContext structure to include the parent context
2020-06-22 14:38:38 +02:00
Olivier Goffart
8f0520f2be Repeater in the viewer 2020-06-17 15:43:57 +02:00
Simon Hausmann
84d8eaa130 Add support for emitting signals for nodejs and the interpreter
This also enables the property and signal accessor test case for js.
2020-06-12 10:38:01 +02:00
Olivier Goffart
58618c0683 Documentation for the interpreter 2020-06-10 09:26:11 +02:00
Simon Hausmann
afd7319ae5 Rename corelib to sixtyfps_corelib
This is consistent with the other packages and since corelib is now also
a cdylib, libsixtyfps_corelib.so looks much better than libcorelib.so
:-)
2020-06-09 13:27:18 +02:00
Olivier Goffart
9fc60e104f Add another way to load .60 files from a build script 2020-06-05 13:45:38 +02:00
Olivier Goffart
3651885d87 Move the compiler binary in tools/
And rename sixtyfps_compiler to sixtyfps_compilerlib
2020-06-05 09:23:38 +02:00
Olivier Goffart
7a8c549625 Be able to read or write properties from JS 2020-06-04 15:48:39 +02:00
Olivier Goffart
49d2aec7e2 Node: add possibility to add signal handler
Right now, this only works once and then panic the second time
2020-06-04 12:49:33 +02:00
Olivier Goffart
5ee09398e8 Node: Allow to init properties to value 2020-06-03 17:33:45 +02:00
Olivier Goffart
30d61452ba Interpreter and node API: some refactoring towards being able to set properties from JS 2020-06-03 17:33:43 +02:00
Olivier Goffart
fd829fc89f Some more refactoring of the interpreter
Move the content of lib.rs to a module so we can have some
kind of public api in the lib.rs
2020-06-03 17:33:26 +02:00
Olivier Goffart
0a48252702 Interpreter: implement the ComponentVTable properly
with the drop and construct function
2020-06-03 17:33:26 +02:00
Olivier Goffart
8cfde5be5e Refactor the creation of dynamic type in the viewer
Put the creation of dynamic type in another module.
Respect the alignement.
2020-06-03 17:33:26 +02:00