Commit graph

29 commits

Author SHA1 Message Date
Simon Hausmann
92f3a9a5ac winit backend: Enable Skia by default on iOS, etc. (but not macOS) 2025-05-09 20:54:47 +02:00
Simon Hausmann
bd0a486da8 Clean up cfgs for Apple operating systems
Replace ios specific cfgs with "apple but not macOS", dubbed
ios_and_friends, so that we also cover iPadOS, etc.. What those have in
common is that they don't have user-resizable windows. (We might want to
add visionOs in the future)

Also, simplify a few macos or ios cfgs with just target_vendor =
"apple", for what applies to all the operating systems.
2025-05-09 20:54:47 +02:00
Olivier Goffart
71e331995c Don't depend on muda on Linux 2025-01-08 14:05:35 +01:00
Simon Hausmann
6c60f9b2a5 Use ashpd to detect dark/light mode on Linux.
The previously used dark-light crate is going to switch to ashpd, so we
might as well use it directly. This is using an older version to match the
zbus version used with accesskit.

This could be extended in the future to use spawn_local and use the stream
provided by ashpd to listen to theme changes.

Fixes #4392
2024-12-17 16:06:21 +01:00
Simon Hausmann
bfdf0e275f Clean up Apple cfg's
Use target_vendor = "apple" where to cover all Apple OS, and exclude ios for event pumping.
2024-12-13 11:03:44 +01:00
Simon Hausmann
7e3747041f Fix simulator build
Amends ac9b85049a
2024-10-23 19:18:57 +02:00
Tobias Hunger
58e85ef317 winit: Suppress warning about web_sys_unstable_api cfg
This is supposed to be set via `RUST_FLAGS` by users of our crate,
so allow it in `cfg`.
2024-08-14 15:55:49 +02:00
Olivier Goffart
60569673b5 Remove some cargo:rustc-check-cfg output:
- The cfg_aliases crate does it out of the box already
 - Don't create a build.rs for this only purpose when it can be added in
   Cargo.toml lints group. (This wasn't possible when the warning was
   first introduced in nightly)
2024-07-02 13:33:48 +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
Simon Hausmann
43e3c57b3b Prospective fix for rustdoc warnings about unknown cfg's
Let cargo know about our internal cfgs.
2024-05-06 12:00:44 +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
Simon Hausmann
3a9288003d
Re-enable accesskit (#3833)
Port to the latest accesskit and accesskit_winit:

- NodeId is now a u64 instead of u128, so trim the component/item encoding.
- Adjust to some enum renamings.
- TreeUpdate now always requires a focus node, which we set to the root.
- Fixed focus handling on macOS: Report FocusIn to the accesskit
  adapter, so that it can update its internal host_is_focused state
  correctly.
2023-11-05 09:04:05 +01:00
Olivier Goffart
12cd8e71f1 WIP: some polish over the winit update to 0.29 2023-10-23 14:22:48 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Simon Hausmann
2e7cc49567 Initial AccessKit support
This change adds initial accessibility support for the winit backend
through use of AccessKit.
2023-06-15 13:20:14 +02: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
481288d489 Initial support for rendering with Skia and Vulkan
Closes #1546
2023-05-09 08:58:35 +02:00
Simon Hausmann
a45421b425 Speed up Linux builds
Remove the dark-light dependency, as it significantly slows down the
build on Linux. On Windows/Mac/Web it's not needed. On Linux Desktop,
folks are likely going to have Qt installed - where this works - and on
Embedded Linux the assumption is that it's not running as Linux Desktop.

On Linux the number of dependencies for `-p slint` goes down from 418 to
328. Build time on my machine goes from 1 minute down to ~50 seconds.
2023-03-28 11:32:59 +02:00
Simon Hausmann
9fcce74b2f Fix build with RUST_FONTCONFIG_DLOPEN
Since the fontconfig ffi code moved to the femtovg renderer create, we
need to build the build.rs feature setting.
2023-03-06 16:40:26 +01:00
Simon Hausmann
1473637ce3 Remove dark-light dependency on the web
winit 0.28.2 was released today, which supports `Window::theme()` on the
web.
2023-03-02 18:53:55 +01:00
Simon Hausmann
155b1443e2 Add support for reacting to dark/light mode theme changes with winit
On macOS and Windows, use winit's `Window::theme()` instead of
dark-light, to detect the theme.

Always react to WindowEvent::ThemeChange. It's delivered on macOS,
Windows, and the web.
2023-02-17 16:11:44 +01:00
Simon Hausmann
01d2efce4e Move the Skia renderer into a separate crate
The crate is an internal crate until the API has been polished and
documented, after which we can call slint-renderer-skia for example.

This also duplicates a little bit of the glutin setup code, because
that would otherwise have to go into another shared crate.
2022-12-09 17:04:54 +01:00
Be
ecb6fd5309 switch to yeslogic-fontconfig-sys from servo-fontconfig
This allows setting the RUST_FONTCONFIG_DLOPEN environment variable
to dlopen fontconfig at runtime rather than linking it at build
time. This is helpful for cross compiling to Linux, particularly
because fontconfig has lots of C dependencies. Building a vendored
copy of fontconfig does not work as expected:
https://github.com/slint-ui/slint/issues/88
2022-10-05 15:21:54 +02:00
Olivier Goffart
8850959a2c Rename the backend feature flags 2022-09-07 17:11:57 +02:00
Simon Hausmann
5fe212f459 Make sure that skia_backend_opengl is always set on Linux 2022-09-05 14:07:27 +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