Commit graph

436 commits

Author SHA1 Message Date
Simon Hausmann
e35d05f6b9 API Review: Remove SharedImageBuffer from public API and rename Window::grab_window() to take_snapshot()
Use SharedPixelBuffer as return value for take_snapshot() and provide counter-parts to from_rgb* in Image as to_rgb*
2024-07-05 20:46:55 +02:00
Olivier Goffart
5dfa8d56dc API review of the slint interpreter Compiler api
Closes #5466
2024-07-05 17:20:08 +02:00
Simon Hausmann
544e4151ac Fix broken link to quick start in Rust API docs 2024-07-05 09:29:56 +02:00
Danut Enachioiu
033e4de9b9
Update language-specific docs to document that public functions can be called from the backend code (#5522)
* Examples for calling public functions in language-specific docs.

* Update the function example so it actually uses its parameter.

(This broke some c++ tests because of the unused argument warning)
2024-07-03 12:13:08 +02:00
Simon Hausmann
b45945a234
Add support for async unit testing and element handle click events (#5499)
This patch adds async click functions to ElementHandle and adds timer support to the testing backend's event loop.
2024-06-27 17:05:58 +02:00
Olivier Goffart
42a2c6a569
Only generate code for the exported Window
Have a warning when a component is exported from the main file and
doesn't inherit Window.
Unless it's the last component, for compatibility with Slint 1.6

Also don't warn in the interpreter
2024-06-25 15:13:06 +02:00
Olivier Goffart
2fd8744cfc compiler: Move embedded_file_resources from the root Component to the Document 2024-06-20 12:03:38 +02:00
Simon Hausmann
db3d726886 Make it possible to retrieve a SharedImageBuffer for a slint::Image in Rust
This change exposes functionality of already existing internal API
that all renderers use to obtain pixels for upload to the screen - so
it's rather well tested.

This also exposes the `SharedImageBuffer` API, an enum that represents
different SharedPixelBuffer encodings.
2024-06-11 07:46:57 -07:00
Olivier Goffart
3da0ee5bb9 DatePicker: Logic in C++
Had to simplify a bit the rust logic to make it work
2024-06-06 09:03:50 +02:00
Florian Blasius
973ecac989 DatePicker: finished features 2024-06-06 09:03:50 +02:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02:00
Simon Hausmann
a52fe6bbfc Make element debug information configurable
The `SLINT_EMIT_DEBUG_INFO` environment variable needs to be set for Rust and C++ builds. For the interpreter it's always enabled, since ... we have it.
2024-06-05 01:29:58 -07:00
ogoffart
3a6e34ba45 Bump version number to 1.7.0 2024-06-04 20:34:29 +00:00
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +02:00
Olivier Goffart
ce1b4f32e8 Janitor: fix formatting 2024-06-03 16:05:51 +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
Wilston Oreo
23f7a7864d
Some Android and MCU doc (#5286)
MCU: Add missing info for software renderer
Android: Add some more details for dev env setup
2024-05-22 18:25:44 +02:00
Michael Winkelmann
95e371b3fc mcu.md: Add "renderer-software" as feature 2024-05-16 11:40:20 +02:00
Simon Hausmann
3c5bd71a3b doc: more version bumps 2024-05-13 09:36:17 +02:00
Simon Hausmann
dea86e1e34 doc: bump version from 1.5.0 to 1.6.0 2024-05-13 09:34:37 +02:00
Olivier Goffart
ebc4a14602 Update the android-activity crate by adding a new feature
The android-activity 0.5 no longer works with Rust 1.78 because it
asserts with
> slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`

Note that the documentation is build with the 05 feature because it also
build the winit backend crate in the same command that still depends on
android-activity 0.5 via winit
2024-05-07 12:48:49 +02:00
Olivier Goffart
cadcd4caf4 Change callback: rust code generation 2024-05-02 22:25:53 +02:00
Olivier Goffart
f45bab6a3f swrenderer: Support multiple rectangles for the dirty regions
This allow to be much faster in the case two small area of the screen
changes.
2024-04-26 14:45:23 +02:00
Olivier Goffart
d4741efac0 testing: rename the init function 2024-04-18 18:45:31 +02:00
Olivier Goffart
8030732f46 Refactor the testing backend
Move code around and gate the internal functions used in our own tests
so we can make the testing backend public
2024-04-18 18:45:31 +02:00
Olivier Goffart
13127dc71c Accessibility: Add support for accessibility-action-* callback (#5073)
Merge branch 'feature/accessibility'

 Conflicts:
	internal/compiler/widgets/cosmic-base/button.slint
	internal/compiler/widgets/cupertino-base/button.slint
	internal/compiler/widgets/fluent-base/button.slint
	internal/compiler/widgets/material-base/button.slint

Also updated license header in actions.slint
2024-04-16 15:02:25 +02:00
Simon Hausmann
305e02e334 Revert "Add a "image-default-formats" feature" and "Janitor: Update the image crate"
This reverts commit a159562ea7 and just
the version part of commit 1d2201a7ce to
downgrade image to 0.24 again.

This is not a straight revert, the workspace unification remains, just
the version is down to 0.24.

The update to the new image crate version causes two issues

- With the Xtensa Rust toolchain, a release build of the image crate
  takes excessively long (cargo +esp build --release in image-rs)
- The image crate version updates to zune-jpeg for JPEG decoding,
  which uses "cdylib" in crate-type, which in turn breaks the
  cross-compilation with Corrosion against a Linux sysroot, because
  the (unnecessary) zune-jpeg cdylib creation doesn't see corrosion's
  link args that provide the sysroot.
  (upstream PR at https://github.com/etemesi254/zune-image/pull/187 )

By reverting, this also closes #5068.
2024-04-16 14:55:50 +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
a159562ea7 Add a "image-default-formats" feature
To enable the feature from the image crate.
And enable it by default.
Because users of older version of slint may have enabled feature from
the image 0.24 crate. But since we upgrade to image 0.25, this these
format would not be supported by Slint. So enable them by default to
keep compatibility
2024-04-15 12:11:54 +02:00
Chris Chinchilla
7afa34a7e1
Rename tutorial to quickstart (#4941) 2024-04-04 13:26:24 +02:00
Olivier Goffart
523e1a161c WIP: More on support for accessibility actions
Continue with the core library support and the compiler support.

This hasn't been tested yet and is missing implementation in the
backends
2024-03-28 11:28:56 +01:00
ogoffart
6bf40989d9 Bump version number to 1.6.0 2024-03-27 07:49:22 +00:00
Simon Hausmann
ed2816331e
Add support for raw-window-handle (#4918)
Add a `raw-window-handle-06` feature to the Rust API crates, which adds support for version 0.6 of rwh to slint::Window, by delegation adding a `window_handle()` function that returns a struct that implements the corresponding traits from rwh.

HasDisplayHandle could also be provided on the backend, but that can be
done separately if needed.

This is only implemented for the winit backend right now.

cc #877
2024-03-22 14:25:05 +01:00
ogoffart
20c570ab1d Bump version number to 1.5.1 2024-03-18 08:55:01 +00:00
Olivier Goffart
eb2cded6ba Android Docs: add a note that it works also with xbuild 2024-03-15 22:59:07 +01:00
Tobias Hunger
28b96ca6f6 janitor: manual cargo clippy fixes
Semi-random selection of clippy topics that were
uncontroversial before:-).

Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
2024-03-14 13:42:38 +01:00
Olivier Goffart
f6d16ee1ef Update version in docs 2024-03-14 09:42:37 +01:00
Olivier Goffart
80b2ac1375 Fix use of deprecated symbols
The toml_edit dependency is required for reading board_config.toml
2024-03-11 17:51:36 +01:00
Christopher-S-25
e550086fc1 Change foo type from i32 to int for Slint's struct 2024-03-04 08:59:32 +01:00
Tobias Hunger
06b04e71b5 compiler: Return the TypeLoader from compile_syntax_node 2024-02-29 19:35:52 +01:00
Olivier Goffart
8bc4c4e053 vtable: increase version number to account for breaking change in vtable::Dyn 2024-02-26 14:45:47 +01:00
Simon Hausmann
d4a6c5774e Add support for writing tests that run with all styles
Tests under tests/cases/for_each_style are run with all styles at least
in the Rust driver.

Amends 6bb9905191 to include a test that
using edited works.
2024-02-23 16:12:45 +01:00
ogoffart
a0eed4e58e Bump version number to 1.5.0 2024-02-20 17:33:11 +00:00
Olivier Goffart
ddebd64064
Android: make slint::android public
Add a `backend-android-activity-05` feature that enables the
`slint::android` module
2024-02-20 15:00:11 +01:00
Tobias Hunger
a8f912900b janitor: Fix warnings in nightly about redandant use 2024-02-19 17:05:21 +01:00
Olivier Goffart
af8075d1b2 Only enable the Qt backend by default on Linux
The trick is that the backend selector build by default with the
i-slint-backend-qt, but the "enable" feature is only enabled if the
qt-backend feature is enabled explicitly, or on linux from the slint
or slint-interpreter crate
2024-02-07 15:20:03 +01:00
Simon Hausmann
fd48321e99
Permit the use of Image, Brush, and related data types in slint_interpreter from Rust without depending on i_slint_core (#4552)
Re-export them just like in the slint crate.
2024-02-06 21:34:30 +01:00
Olivier Goffart
09a5c724bf ListView: Fix redraw when model changes
Amend 48180919da
That commit added the dependency, but did not reset the dirty flag, so
it only worked once.

Fixes: #4538
2024-02-05 15:02:44 +01:00
Yuya Nishihara
004749157f Fix rust codegen to skip over backslash-escaped character
If the generated code contains "\"" and format!("{}", ..), the latter would be
corrupted because the code formatter rewrites "{}" as if it were a code block.
2024-02-02 08:35:03 +01:00