Commit graph

68 commits

Author SHA1 Message Date
Tobias Hunger
df4f9b38ee femtovg: Fix warning about deprecated web_sys::set_fill_style
Use set_fill_style_str insterad, it avoids constructing a JSValue
from a str.
2024-10-16 13:25:00 +02:00
Olivier Goffart
86b9099fdd interpreter: Mark ComponentCompiler as deprecated 2024-07-04 12:47:54 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Olivier Goffart
b2645dff6c Wasm: use the winit spawn() api to run the event loop for the interpreter
This seems to solve the bug that the wasm interpreter (or slintpad) is
not working when compiled in release since the winit0.29 update
2023-10-30 14:17:10 +01:00
Tobias Hunger
df544fe1c9 interpreter: Introduce internal feature
... and use it to hide internal functionality so users will notice that
they depend on fucntionality we do not provide any guarantees for.

Make the lsp and viewer request the internal feature when building the
interpreter.
2023-10-20 15:34:49 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Olivier Goffart
b1e1cd1881 wasm-interpreter: remove the highlight feature
We do the highlighting only from the LSP, even in wasm
2023-08-30 09:55:04 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
ogoffart
aebaa7d6c9 Bump version number to 1.2.0 2023-07-25 10:44:53 +00:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
ogoffart
c8c9496722 Bump version number to 1.1.1 2023-06-26 12:50:02 +00:00
Simon Hausmann
222b2bd782 Serialize component creation and initial show in slintpad and vs code web preview
Turn the instance variable into a Promise itself, where the first
promise that's assigned to it creates the component and shows
it, before resolving the promise with it.

Some associated helper functions that use this.#instance - which is now a Promise - are also async.
In some call sites it doesn't matter, in others an await was added.
2023-06-16 15:53:04 +02:00
Simon Hausmann
26f3aa84fa Fix race in Slintpad causing preview to panic (esp. in FF)
With the following snippet there was a race:

```
if (instance === null) {
    instance = await create();
    await instance.show();
} else {
    instance.create_with_existing_window(...);
}
```

When awaiting for the promise that show() returns to settle, we would re-enter
this function (due to a broken recursion guard, that's now removed).
When re-entering, create_with_existing_window() is called, which - in order to
access the slint::Window to re-use - must create the window adapter.
Since that didn't happen from within an event loop invocation, winit would panic.

Consequently, this patch set also makes create_with_existing_window() return
a promise, as well as hide() (for the sake of it).

The broken recursion guard is easy to fix (with a .finally() handler setting
the boolean back), but that would mean we end up not always rendering
the very latest sources. Plus, the same issue exists in wasm_preview.ts.

Now, in case of subsequent re-entrancy in this code, we end up creating
a bunch of create_with_exiting_window() promises, which will eventually
settle and then we go back to the original show() call that will show the canvas.
2023-06-16 15:53:04 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Tobias Hunger
04d1229685 Fix licnese information using xtask 2023-06-16 09:14:20 +02:00
ogoffart
641cab0e75 Bump version number to 1.1.0 2023-06-15 16:01:28 +00:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
401a6dda4d
Fix preview in SlintPad and VS code web extension (#2871)
The interpreter now creates the window typically in show(), so similar
to commit a8fcb5acd6 make show() return a
promise and invoke show() from within the event loop.

Amends d98c6773e1
2023-06-13 16:29:43 +02:00
Simon Hausmann
ca3a6bd586 Fix Qt High-DPI support with the interpreter
See parent commit for details.
2023-06-10 11:41:04 +02:00
Simon Hausmann
a8fcb5acd6 Fix delayed docs preview not working
After commit 7df902b53c, the winit window
is not created when calling show() anymore but it's now created at
component creation time.  That means the event loop workaround removed
in 459f810bd8 is now needed at
construction time.

Since this is a winit and wasm specific issue, it's now dealt with in
the wasm interpreter implementation, by invoking the creation from the
event loop from there and returning a promise in the API.

This changes the API therefore: create() can only be called after the
event loop is running.
2023-06-01 16:51:12 +02:00
ogoffart
dfd5fc38b3 Bump version number to 1.0.3 2023-04-26 14:04:08 +00:00
ogoffart
53cce5bf44 Bump version number to 1.0.2 2023-04-26 11:33:16 +02:00
Tobias Hunger
893983e8d3
Slintpad: Add picker mode where you can click on something in the preview and the editor focuses on that (#2567)
* compiler: Make mapping from source offset to line/column more reusable
* compiler: Improve mapping of offset to line/column
* Fix unit tests after line mapping update
* interpreter: Add code to have a element picker mode
* slintpad: Add picker mode to the preview
* slintpad: Do not try to highlight "empty" highlight requests
* Slintpad: Cycle through all the possible elements in design mode
* Slintpad: Ignore builtins and eat less clicks
* Slintpad: Highlight the element selected in design mode
* Slintpad: Do not use static mut variable in design mode
* slintpad: Rename `set_current_element_information_callback`
* Interpreter: Do not use unsafe in design mode code

Done with: @ogoffart and @tronical
2023-04-18 23:11:08 +02:00
ogoffart
bd63218412 Bump version number to 1.0.1 2023-04-18 14:56:40 +00:00
Simon Hausmann
8ffb5131c7
Introduce error handling in the FemtoVG and Skia renderers (#2402)
Avoid unwrap() and expect() and instead propagate errors all the way
down to run_event_loop(), show(), and hide() in the Slint AIP.
2023-03-24 14:18:11 +01:00
Tobias Hunger
d09833d664 wasm-interpreter: Fix warnings about ignored results 2023-03-16 12:53:13 +01:00
Olivier Goffart
8450e01a3f
Change the name of the compat feature (#2230)
And remove the compat-0-2-0 and compat-0-3-0 features
2023-02-16 09:40:44 +01:00
Olivier Goffart
6889dfa5f5 Rust: Make new(), run() and show() report errors from the backend
Fixes #2198
2023-02-10 05:00:03 +01:00
ogoffart
e7f48512ee Bump version number to 1.0.0 2023-02-03 11:07:15 +01:00
Olivier Goffart
16354c2c25 vscode browser: implement the highlight 2023-01-22 10:16:15 +01:00
Simon Hausmann
587c9f6942
Prospective build fix for vs code extension build
The wasm interpreter isn't built with the highlight feature there.
2023-01-21 09:20:22 +01:00
Tobias Hunger
82bc71b245 tools: Improve highlighting in the interpreter
Trigger the event loop once, so that the highlight gets rendered without
further user interaction.
2023-01-20 18:27:11 +01:00
Tobias Hunger
15bd48d2fa tools: Add highlight feature to wasm-interpreter
... and use it.
2023-01-20 18:27:11 +01:00
Tobias Hunger
ee3f714638 tools: Turn on highlight support in wasm-interpreter 2023-01-20 18:27:11 +01:00
ogoffart
ce07d078ce Bump version number to 0.3.4 2022-12-16 09:36:15 +00:00
ogoffart
fb02b4118b Bump version number to 0.3.3 2022-11-28 13:11:11 +00:00
ogoffart
2171773a3e Bump version number to 0.3.2 2022-10-28 09:30:14 +00:00
Simon Hausmann
a8849c1ede Enforce the signature of the file load callback in the wasm build of the interpreter and the lsp 2022-09-30 13:24:04 +02:00
Olivier Goffart
b7a10dd317 Remove unused wee_alloc dependency
It is not even used, and has security issue.
Fixes https://github.com/slint-ui/slint/security/dependabot/2
2022-09-16 19:24:04 +02:00
ogoffart
261614b914 Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
Olivier Goffart
419016a356 Rename the compat feature again
crates.io won't let us upload a feature with dots in it:

```
Uploading slint-interpreter v0.3.0 (/home/olivier/slint/internal/interpreter)
error: failed to publish to registry at https://crates.io

Caused by:
  the remote server responded with an error: invalid upload request: invalid value: string "compat-0.3.0", expected a valid feature name at line 1 column 2254
```
2022-09-14 15:55:57 +02:00
Olivier Goffart
8850959a2c Rename the backend feature flags 2022-09-07 17:11:57 +02:00
Olivier Goffart
15fa69ef55 Rename the compat-0-2-0 feature to compat-0.3.0
But keep a compat-0-2-0 fome compatibility anyway
2022-09-07 14:09:07 +02:00
Simon Hausmann
d9efc95dda Fix console errors in the online editor about GL context losses after some editing
There's a memory leak that causes the created canvas elements not be
deleted.  I've tried a few thing such as explicitly hiding the window
(destroying the canvas element instance refs and gl resources we keep in
Rust), but it's not enough - somewhere there remains a circular
reference. Possibly between some of the closures installed in Rust and
DOM elements they are installed on as event handlers.

I also tried using the wasm-bindgen support for weak refs, but no luck.

So instead, to plug the leak, this patch introduces the re-use of the
HTML canvas element in a way that is similar to how the preview works in
vs code's live preview.

I verified that no GL resources or new canvas elements are leaked in
Chrome's heap profiler via snapshot comparison and filtering for the
corresponding DOM element types.
2022-09-07 12:03:37 +02:00
ogoffart
05a49da906 Bump version number to 0.3.0 2022-09-06 13:00:22 +02:00