Invoking the diagnostics getter would throw an exception because the JsDiagnostic type has no constructor.
There's however no constructor that would allow for the previous
laziness, so instead this PR bites the bullet:
- When diagnostics are requested, we convert them all in one go into proper JavaScript objects.
- The vector returned by line_column is replaced with more idiomatic column and lineNumber properties
* Startup with napi.
* Added interpreter api for napi.
* Initial implementation of set_property/get_property on ComponentInstance
Co-authored-by: Florian Blasius <FloVanGH@users.noreply.github.com>
* fixup! minimal napi setup
* Type conversion for napi.
* Work on napi callbacks.
* Fix life-time of JsFunction kept in closures for callbacks
The life-time of napi values is limited to the method invocation from napi itself.
In order to keep a value beyond that, it's necessary to use persistent references:
https://nodejs.org/api/n-api.html#references-to-values-with-a-lifespan-longer-than-that-of-the-native-method
* Added callback tests for napi.
* Fix licenses for napi stuff.
* Update api/napi/src/interpreter/component_instance.rs
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
* Update api/napi/src/interpreter/component_instance.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Code review stuff
* Update api/napi/src/interpreter/component_definition.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update api/napi/src/interpreter/component_instance.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update api/napi/src/interpreter/component_instance.rs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* code review fixes
* ci fix
* code review fixes.
* up
* Revert "up"
This reverts commit 06412f1acf.
* ci fix
---------
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Co-authored-by: Florian Blasius <FloVanGH@users.noreply.github.com>
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Unfortunately, this is currently not mapped to the right keyboard layout
Also keep the mouse clamped in the visible area.
And make it start in the middle of the screen.
- Fix pre-processor include search path setup so that pre-processing
slint.h finds slint_internal.h and (most importantly)
slint_generated_public.h for the feature defines.
- Add missing documentation that caused doxygen errors.
This doesn't require a windowing system, just Linux and Vulkan drivers
that supports the display extensions.
It's called linuxkms as soon this will go beyond Vulkan and also support
EGL and perhaps dumb buffers for software rendering.
Add a ComponentFactory type which will eventually be used as a property
value in Slint. The idea is to copy around this type and to create
components from it that we can embed.
We do not want to hand raw components around as those are reference counted
and might end up being embedded into several places, which would break out
tree of components.
Copying the Rust enum instead of using cbindgen because we would need to
create a new header just for it for bublic types generated in the
platform namespace. I've also put it in the SoftwareRenderer class since
the equivalent enum is in the software_renderer module in Rust.