Commit graph

282 commits

Author SHA1 Message Date
Simon Hausmann
25b380bcc8 Fix failing test-driver-nodejs based color tests
Same fix as parent commit
2023-10-25 16:16:27 +02:00
Simon Hausmann
4e80faa3b8 Fix tests not passing in debug mode
napi would assert when we extract an object from a reference twice:

```
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/napi-2.13.3/src/js_values/value_ref.rs:59:5:
assertion `left == right` failed: Ref count is not equal to 0 while dropping Ref, potential memory leak
  left: 1
 right: 0
stack backtrace:
```

Fix this by avoiding the use of Ref.
2023-10-25 16:16:27 +02:00
Simon Hausmann
2fc418251b node: remove workaround for font imports with relative paths
Commit a76c3ec789 fixes the underlying issue.
2023-10-25 15:04:55 +02:00
Simon Hausmann
192e04bea3 Fix broken doc link 2023-10-25 09:05:59 +02:00
Florian Blasius
bf77b064ab
Replace neon node port (#3744)
* Update api/node/README.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-24 15:07:59 +02:00
J-P Nurmi
c5248c005e Allow specifying paths for @library imports 2023-10-20 16:47:00 +02: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
Florian Blasius
2324b35d12
napi test driver setup (#3635)
* Export interpreter stuff on private_api namespace

* Update api/napi/src/interpreter/value.rs

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update tests/driver/napi/build.rs

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update tests/driver/napi/Cargo.toml

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>


* Avoid unwanted prompt on Windows when running npm run build twice

Don't generate "napi.js" as then Windows will try to open it when running just "napi",
if nodejs registered .js as extension.

* Remove windows path workaround

It doesn't look like that it is needed.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2023-10-11 12:48:27 +02:00
Olivier Goffart
852b4d906d Rename ComponentVTable to ItemTreeVTable
and their related name.
Also move the component module in the item_Tree module
register_component -> register_item_tree
ComponentItemTree -> ItemTreeNodeArray

For #3323

Rationale from that issue:

Right now, we use the term `component` in the Slint language and in the compiler to be a a tree of elements that can be used as an element in a .slint file.

The term is also currently used in the runtime as a tree of runtime Items that are allocated together. (declared in ComponentVTable)

But there are no 1 to 1 mapping between a `component` in the slint language, and a runtime Component.
(for example, the items behind a `if` or `for` or `PopupMenu` are in a different runtime component. And `component` declared in Slint are often inlined)

So we should rename the internal runtime `Component` to  `ItemTree`

The currently public `slint::ComponentHandle` wraps the "root" of the ItemTree, but that's ok because it is generated from a .slint `component`,  so it doesn't change name
2023-10-09 11:01:56 +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
Olivier Goffart
a565ed53fd Upgrade MSRV to 1.70
Many of our dependencies already made the jump and require a cargo update hack, so make it official

Removed the MSRV from the README since it applies to master branch and people read the readme also for
the released version. There is enough documentation of the MSRV in other locations.
2023-09-06 12:09:03 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Olivier Goffart
fde561a56a Some improvements to Window visibility
- From C++, always call the Window::show() and hide() function instead
   of going through set_visible directly as it doesn't set the size of
   the WindowItem
 - show() should also call resize on the renderer
 - remove the is_visible in the WindowAdapterInternal as it is no longer
   needed
2023-08-30 13:05:35 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Tobias Hunger
2840886d28 Add component-factory type to Slint language
Add a type "component-factory" to the Slint language.
2023-07-27 12:04:16 +02:00
Simon Hausmann
af97435463 Replace show()/hide() in the WindowAdapter with set_visible(bool)
This makes for a smaller interface.
2023-07-26 13:53:45 +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
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
Olivier Goffart
0e31f097a4 Un-seal the WindowAdapter trait 2023-06-13 17:44:04 +02:00
Olivier Goffart
5f84cd5a90 Change the return type of WindowAdapterSealed::position to be an Option 2023-06-12 19:25:33 +02:00
Simon Hausmann
eadfec64a3 Add support for importing OpenGL textures into Slint
This is the initial API for Slint to borrow OpenGL textures from the
application for rendering.
2023-06-01 15:56:55 +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
ogoffart
bd63218412 Bump version number to 1.0.1 2023-04-18 14:56:40 +00:00
Olivier Goffart
9a51114387 Nodejs: add some documentation of the dependencies
Fix #2220
2023-03-30 09:42:00 +02:00
Simon Hausmann
d85ea23e4d doc: Apply beta tag also to nodejs built docs
See commit 7343828ed0
2023-03-28 08:45:09 +02:00
Simon Hausmann
7343828ed0 Emphasize that NodeJS support is beta quality 2023-03-27 18:03:02 +02: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
Simon Hausmann
128fb25629 Enable support for additional image formats (webp, etc.) in the viewer, previewer, and nodejs bindings 2023-03-23 15:35:13 +01:00
Tobias Hunger
78892cdf1f docs: Fix broken links in our docs. 2023-02-22 17:08:30 +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
Tobias Hunger
d93445bd0b docs: Remove inline langref documentation and link the mdbook
For node and cpp, I use relative links to point to the slint language
reference documentation.

For the slint crate documentation I create a link to
https://slint-ui.com/releases/VERSION/... instead: This needs to work from
docs.rs as well as from our own docs area on slint-ui.com! That is
pretty ugly: I can not even define constants for this as the crate docs
need to come before anything else.
2023-02-07 12:10:07 +01:00
ogoffart
e7f48512ee Bump version number to 1.0.0 2023-02-03 11:07:15 +01:00
Olivier Goffart
16fdd0595b interpreter: Rename invoke_callback to invoke
Since it can be used to invoke both functions and callbacks
2023-01-02 23:55:47 +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
Simon Hausmann
d8a1f2cf01 Introduce a rem unit in the type system
This allows specifying font sizes relative to the Window's
default-font-size, similar to CSS rem.
2022-11-24 11:33:38 +01:00
Simon Hausmann
e9db914fb1
Add is_visible to NodeJS and C++ Window types (#1816)
Amends commit 82278a5742
2022-11-04 16:24:24 +01:00
ogoffart
2171773a3e Bump version number to 0.3.2 2022-10-28 09:30:14 +00:00
Olivier Goffart
28ae8f7bc4 Refactoring: split ElementType away from the types used as property type
These are two different concept, and it is confusing to keep them in the
same enum

We want to support component without any base element, and Void is
already used for global component, so do this refactoring before
2022-10-26 14:50:44 +02:00
Simon Hausmann
3cc524ad1d
Fix broken link to nodejs example 2022-10-12 22:26:23 +02:00
ogoffart
261614b914 Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
Tobias Hunger
53a3c72b57
api: Change logical/physical position and size on window (#1620)
* Add `RequestedSize` and `RequestedPosition` enum to enable asking for
  logical or physical size/position.
* Rename `Window::size()` to `Window::physical_size()`
* Make `Window::set_size(...)` take an `Into<RequestedSize>`
* Rename `Window::position()` to `Window::physical_position()`
* Make `Window::set_position(...)` take an `Into<RequestedPosition>`
* Change `WindowAdapter` and related classes to be able to handle
  requests being made in the either physical or logical units.

Implement this for C++, Rust and node.
2022-09-13 08:55:31 +02:00
Simon Hausmann
7967bf1ab0 Replace the internal WindowHandleAccess trait with a helper function on WindowInner
The reversal of ownership removes the need for the glue trait in the
publicly visible API.
2022-09-06 16:17:06 +02:00