Commit graph

174 commits

Author SHA1 Message Date
Simon Hausmann
012dc34975 Remove the Rust and C++ migration guides from the documentation 2022-09-09 16:53:49 +02:00
Simon Hausmann
8251d60185 Build on docs.rs also with log
The document-features feature will end up with markup that references the log crate.
2022-09-09 11:18:16 +02:00
Simon Hausmann
76aea0c2d4 Remove renderer-winit-software from the docs.rs feature flags
That flag used to enable the software renderer API, but not anymore.
2022-09-09 10:07:20 +02:00
Simon Hausmann
6875e35ec9
Polish the platform module level-docs (#1616)
Various edits and tweaks.
2022-09-09 09:24:59 +02:00
Simon Hausmann
8ee88a53c1
MCU Doc fixes (#1615)
Various edits to the introduction of how to use Slint on MCUs.
2022-09-09 08:35:01 +02:00
Olivier Goffart
1ba4450115 Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-09-07 17:11: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
Tobias Hunger
8b66194aca Fix doc for renderer-software feature
Also fix casing in `mcu.md` headline
2022-09-07 10:11:11 +02:00
Tobias Hunger
625546304c Remove software-renderer feature more aggressively
I missed some instances as the CI and @ogoffart both pointed out. Fix
that.

Also make the `text_layout`and `ìnteger-sqrt` features that were set by
the `swrenderer` feature mandatory -- by removing them completely.
2022-09-07 10:11:11 +02:00
Tobias Hunger
d880ef8eb5 api: Remove software-renderer feature 2022-09-07 10:11:11 +02:00
Tobias Hunger
639dcaf702 api: Rename module swrenderer to software_renderer
Also rename the `swrenderer` feature to `software-renderer`.
2022-09-07 10:11:11 +02:00
Olivier Goffart
d5e27a9788 Move the documentation of the log feature before the backends
We do that by using the `dep:` trick in the Cargo.toml
2022-09-06 18:33:20 +02:00
Olivier Goffart
88d231f3ec Move the testing module from away from public api
move it the testing backend
2022-09-06 17:27:15 +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
ogoffart
05a49da906 Bump version number to 0.3.0 2022-09-06 13:00:22 +02:00
Olivier Goffart
40f489041e Rename slint::internal to slint::unstable_private_api and move re_exports into it
Also move the module in its own file
2022-09-06 05:42:11 +02:00
Simon Hausmann
3a1817de3f Skia: Make it possible to explicitly select the OpenGL backend of Skia
When opting into the Skia renderer, we default to metal on macOS and D3D on Windows.
However if you want to develop a cross-platform application with Skia and
for example rely on OpenGL to be able to implement an OpenGL underlay or overlay,
then we need the ability to explicitly opt into skia's GL renderer.

cc #1445
2022-09-05 14:07:27 +02:00
Olivier Goffart
0085145d10 MCU documentation 2022-09-04 18:31:26 +02:00
Olivier Goffart
d4df55e6ab Move non-backend features outside of the backend section 2022-09-03 11:15:26 +02:00
Simon Hausmann
437218db70 Replace the built-in defmt debug logging to the platform trait
This way we don't have to add defmt, esp32-println and others as features to corelib and the slint api crate
(which would also expose them as public dependencies),
but instead this can be simply delegated to the Platform trait.
2022-09-02 20:13:41 +02:00
Tobias Hunger
3430a13bf8 API cleanup: Remove quit behavior parameter from run_event_loop 2022-08-30 08:34:45 +02:00
Olivier Goffart
396a2c5ecb Implement std::fmt::Write for SharedString and add a format! macro 2022-08-29 17:25:24 +02:00
Tobias Hunger
10c3c9d16d Api cleanup: Rename some remaining platform abstractions to platform 2022-08-29 16:53:47 +02:00
Tobias Hunger
88cf874d03 API cleanup: Rename create_window to create_window_adapter 2022-08-29 16:53:47 +02:00
Tobias Hunger
1e6ffeaa0f API cleanup: Rename PlatformWindow to WindowAdapter 2022-08-29 16:53:47 +02:00
Tobias Hunger
53053683a1 API cleanup: Rename PlatformAbstraction to Platform 2022-08-29 13:26:36 +02:00
Olivier Goffart
8fba65a282 Rename and expose the unsafe-single-threaded feature 2022-08-25 16:47:53 +02:00
Simon Hausmann
bf801cfdda Remove mcu bsp feature dependency on i-slint-core for defmt and libm
Make both features of the slint crate
2022-08-25 12:54:52 +02:00
Simon Hausmann
94d5444105 Remove swrenderer feature dependency on i_slint_core from mcu bsp crate
Let `renderer-software` enable the API in `slint::platform::swrenderer` and optionally toggle winit support.
2022-08-25 12:54:52 +02:00
Simon Hausmann
d90b503a1c Move the mcu backend to become a board support helper crate for examples 2022-08-25 12:54:52 +02:00
Olivier Goffart
1884ddf4c6 Add api so slint-build to chose how to embed the images 2022-08-24 18:18:44 +02:00
Olivier Goffart
13c9c3bbab Re-export the platform module as public api in slint::platform
Tweek some documentation
2022-08-24 14:28:51 +02:00
Olivier Goffart
7417422e3c Make the PlatformAbstraction not Send using a EventLoopProxy trait
This changes the way the platform abstraction is initialized
2022-08-24 11:32:21 +02:00
Olivier Goffart
2e5ab86bea Rename backend module to platform
and the Backend trait into PlatfromAbstraction trait
2022-08-23 19:39:49 +02:00
Olivier Goffart
5c89680e9f slint-build: fix code formater in presence of '\u{..}'
It would insert newline after the `}`  and break the build
2022-08-23 14:46:21 +02:00
Olivier Goffart
a27806aca8 Add a feature to use the sofware renderer with the winit backend
Currently, you still need to pass some env variable at build time so it
embeds the font.
2022-08-22 19:02:28 +02:00
Simon Hausmann
1d436778c1 Remove the use of the PlatformWindowRc alias again
and use Rc<dyn PlatformWindow> instead. The alias has to stay with the ffi
functions though and the item vtable definitions,
because we don't have an Rc<> template in C++.
2022-08-19 15:07:27 +02:00
Simon Hausmann
98e1befd0d Port the C++ generator and C++ API to the new window ownership model
One key difference to the Rust way is what `slint::Window` means. In
Rust that holds the `WindowInner` and `slint::Window` is only exposed as
`&slint::Window`. This is possible because the component owns the
`Rc<dyn PlatformWindow>`, which has a function to return the
`&slint::Window`.

In C++ `slint::Window` is also exposed as `slint::Window&` in the
`window()` getter, but there's no way to get a reference to a  C++
wrapper for the Rust `&slint::Window` that the `PlatformWindow` trait
returns. Therefore in C++ `slint::Window` wraps `Rc<dyn
PlatformWindow>`.
2022-08-19 15:07:27 +02:00
Simon Hausmann
fd026a3991 Change itemtable to use &PlatformWindowRc instead of &WindowInner
The former is cbindgen friendly, the latter is entirely Rust internal.
2022-08-19 15:07:27 +02:00
Simon Hausmann
af86f36157 Invert slint:🪟:WindowInner and PlatformWindow ownership
Previously: Window is an Rc<WindowInner>, which has an Rc<dyn
PLatformWindow> - and weak references the other way around.

Now: Rc<dyn PlatformWindow> is the root of window ownership. The impl
PlatformWindow has a slint::api::Window, which just holds a WindowInner.

This change is incomplete on a few levels, mainly that neither of the
code generators nor the interpreter is ported.
2022-08-19 15:07:27 +02:00
Simon Hausmann
771b122198 Add skia renderer skeleton
This one can render basically just plain rectangles.
2022-08-02 12:00:56 +02:00
Simon Hausmann
96372d5dde Remove mention of eventloop-winit-all
There's no -all suffix anymore
2022-07-26 17:43:51 +02:00
Simon Hausmann
c6878c58db Fix up feature comment
These are just internal comments, not for the docs
2022-07-26 17:43:51 +02:00
Simon Hausmann
3619989fcc Rename backend feature flags to accomodate more renderers
Split backend-gl-* into eventloop-winit-* and renderer-femtovg.

The old feature names are still available.

For consistency eventloop-qt and renderer-qt are aliases for backend-qt.
2022-07-26 17:43:51 +02:00
Olivier Goffart
8c70cd7f57
Move the fonts out of the Backend trait (#1438)
and remove the `'static`
2022-07-26 16:45:54 +02:00
Simon Hausmann
fe3d4b7177 Bump MSRV to 1.60 2022-07-26 09:20:52 +02:00
Olivier Goffart
8287ed4b9e Some more simplifications of the PlatformWindow and Backend trait 2022-07-25 14:51:03 +02:00
Olivier Goffart
29404e3f2c Rename i_slint_core:🪟:Window into WindowInner
We already have `api::Window` and also the Window element (`WindowItem`),
So rename the inner part to avoid confusion
2022-07-22 18:12:00 +02:00
Olivier Goffart
30f95e3aca Fix animation-tick() to register that there are running animation 2022-07-12 17:36:04 +02:00