Commit graph

52 commits

Author SHA1 Message Date
Simon Hausmann
06a19e59ad
slint: Change Platform.os to return a new enum OperatingSystemType (#8679)
* slint: Change Platform.os to return a new enum OperatingSystemType

cc #8631
2025-06-12 14:25:16 +02:00
Olivier Goffart
23962b3e25
Upgrade cbindgen and use unsafe(no_mangle) attributes (#8539)
To be compatible with the 2024 edition, we need to wrap the
`no_mangle` attribute in `unsafe()`.

The parsing for that in cbindgen was only added in the version 0.28,
but we couldn't upgrade cbindgen before because of a regression in
cbindgen 0.27 that prevented us from upgrading.
Now that cbindgen 0.29 is released with a fix, we can prepare for the
2024 edition
2025-05-26 11:21:33 +02:00
Simon Hausmann
f983cf0b19 Add Platform.os as well as a rudimentary test 2025-05-06 13:06:27 +02:00
Olivier Goffart
62e9111842 Fix C++ slint_register_font_from_* functions regarding to the error string
The C++ code already instentiate a `SharedString` on the stack, we are
not supposed to ptr::write into it.
Lickyly this didn't have any effect because the default constructed
string can be leaked without problem, but better be correct.

Also aboud temporary String allocation
2025-01-27 19:22:00 +01:00
Olivier Goffart
c98d234b9e Janitor: Always use `#![no_std] for runtime lib
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.

The downside is that there is a bit of churn in the tests
2025-01-27 19:22:00 +01:00
Tasuku Suzuki
68b9dfc247 String: Add .is-empty and .character-count properties
Introduce two new properties for string in .slint:
- .is-empty: Checks if a string is empty.
- .character-count: Retrieves the number of grapheme clusters
  https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

These additions enhance functionality and improve convenience when working with string properties.
2025-01-14 19:29:05 +01:00
Simon Hausmann
1888e58735 Add API to set the XDG app id
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.

Fixes #1332
2024-11-22 11:24:06 +01:00
Arnold Loubriat
67166fcc2d Add the accessible-position-in-set property 2024-10-30 15:54:01 +08:00
Simon Hausmann
8a7db55bb6
Route debug() calls in Slint consistently through Platform's debug_log() (#5718) 2024-07-29 16:31:09 +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
Olivier Goffart
5c3732c74e C++: fix string to float so that it doesn't depends on the current locale 2024-05-07 14:58:07 +02:00
Olivier Goffart
475ced0a62 C++ testing API: Intreoduce the ElementHandle 2024-04-22 11:28:12 +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
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
9111946a82
Introduce slint::run_event_loop_until_quit
Closes #1499
2024-01-11 13:52:02 +01:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Olivier Goffart
fd7fc5ab9b C++, remove the experimental flag
The platform namespace is now always enabled.
2023-07-28 10:36:08 +02:00
Olivier Goffart
ed0e4726d1 C++: use esp-backtrace as a panic handler on the esp platform 2023-07-24 12:20:51 +02:00
Olivier Goffart
422c39d321 C++ Don't use aligned_malloc because we can't rely on that in esp-idf
Instead, try to do the alignment manually for over-aligned allocations
2023-07-21 17:14:43 +02:00
Simon Hausmann
917cecff85 Add support for embedding bitmap fonts in C++ 2023-07-20 16:20:51 +02:00
Olivier Goffart
1805e6c4c1 C++: Make it working to have experimental withoud std 2023-07-18 13:54:59 +02:00
Olivier Goffart
7cffad2c3f C++: add a STD feature enabled by default 2023-07-18 12:44:20 +02:00
Olivier Goffart
008e60b530 C++: implement an allocator that use libc allocator when no_std
It is important to use the same heap, when there isn't a lot of
available memory
2023-07-14 16:12:12 +02:00
Olivier Goffart
4a505c6788 C++: Make the platform support work without the "std" feature
Add a experimental-platform feature that doesn't include skia
2023-07-14 10:46:21 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
aa8ef4e302 C++: add a "std" feature to the slint-cpp crate
And make it no_std otherwise

This is a first step towards getting C++ on MCU (#2136)
2023-07-05 21:48:01 +02:00
Olivier Goffart
9afadf50be Get rid of the "use_modules" workaround
This doesn't seem to be needed anymore with newer rust version.
As long as one symbol from the crate is used, all exported function
from the crate are available.

The reason why some symbols in some module were gone was a bug in rust
that has been fixed, it seems
2023-07-05 13:41:06 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +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
cd9994306e Create the window adapter lazily in C++ 2023-06-13 15:13:42 +02: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
Olivier Goffart
8d686637f4
Experimental platform API from C++ 2022-12-12 12:54:31 +01:00
Olivier Goffart
6ede77436b api: Return an error from invoke_from_event_loop and quit_event_loop 2022-09-07 10:13:58 +02:00
Tobias Hunger
3430a13bf8 API cleanup: Remove quit behavior parameter from run_event_loop 2022-08-30 08:34:45 +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
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
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
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
Olivier Goffart
8c70cd7f57
Move the fonts out of the Backend trait (#1438)
and remove the `'static`
2022-07-26 16:45:54 +02:00
Olivier Goffart
8287ed4b9e Some more simplifications of the PlatformWindow and Backend trait 2022-07-25 14:51:03 +02:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
c846633708 Rename C ffi functions 2022-02-02 11:12:34 +01:00
Simon Hausmann
2f73a27635 Rename the sixtyfps-interpreter crate 2022-02-01 18:11:25 +01:00
Simon Hausmann
9494068201 Rename the sixtyfps-rendering-backend-selector crate 2022-02-01 18:06:49 +01:00