Commit graph

897 commits

Author SHA1 Message Date
Simon Hausmann
35de15ce4b Remove stray CMake cache variable setting
The same line exists unconditionally further down in the same file.
2024-08-28 11:16:55 +02:00
Simon Hausmann
5d03d6e1bd Simplify slint-compiler import location logic in SlintConfig.cmake.in
Instead of detecting the suffix, just copy across the corrosion-determined file name.

Amends 13975d9def
2024-08-25 21:05:55 +02:00
Simon Hausmann
13975d9def Fix locating the slint-compiler.exe on cmake cross-compiled packages
When cross-compiling CMAKE_EXECUTABLE_SUFFIX may not be set to .exe even
though the host is Windows, because this variable always refers to the
target. This is a missing feature in cmake, so work around it for now.
See also https://gitlab.kitware.com/cmake/cmake/-/issues/17553 I made a
similar workaround in Corrosion long time ago with commit
b8a6b26a0f2d526e0492df9fd88c0495b0b8a64f

The target prop line is duplicated in favor of introducing a variable,
that would otherwise be at risk of being visible in the user scope.
2024-08-23 18:10:11 +02:00
Simon Hausmann
e488a36487 C++: For freestanding builds, default to the fluent style
Freestanding implies the lack of windowing system presence and therefore the choice of say Cupertino when building on macOS is not good.

Fluent isn't quite a great choice right now either, as it's not very touch friendly, but it's a compromise :)
2024-08-23 13:25:50 +02:00
Simon Hausmann
327e0d8d95
Fix C++ package names when not cross compiling 2024-08-22 20:15:41 +02:00
Simon Hausmann
d413fd5217
Build binary MCU packages as tarballs (#5900)
This includes xtensa for s3, esp riscv targets, as well as thumbv7
for STM32.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-22 16:16:55 +02:00
Simon Hausmann
d78354f01b
Initial import of STM32 Platform Integration (#5892)
This is a head-only library for now.
2024-08-22 15:55:01 +02:00
Simon Hausmann
9bdade0105 Compile the multiple-includes test with a header-only build of appwindow.slint 2024-08-20 15:53:24 +02:00
Simon Hausmann
c25a03d6f7 C++: Make it possible to split up the C++ code generated for a .slint file
Add a COMPILATION_UNITS argument to slint_target_sources that defines into how many .cpp files to split up a .slint file. The new default is now one.
2024-08-20 15:53:24 +02:00
Simon Hausmann
e54eedc351 Document how to solve the multiple symbol definition errors that sometimes happen with the xtensa toolchains
Closes #5862
2024-08-20 12:44:30 +02:00
Olivier Goffart
a9f526491a Timer Element
Closes #5724
2024-08-16 16:36:38 +02:00
ogoffart
4dd7d96a28 Bump version number to 1.8.0 2024-08-15 12:44:46 +00:00
Simon Hausmann
a727d87796 CMake: Make it possible to override the scale factor
Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-14 11:00:50 +02:00
Simon Hausmann
360f192b91 esp-idf: Adjust touch coordinates to scale factor
Taken from https://github.com/slint-ui/slint/pull/5016/files

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-08-14 11:00:50 +02:00
ogoffart
bbf7edc5a3 Bump version number to 1.7.2 2024-08-09 09:52:17 +00:00
Olivier Goffart
0f8246d598
C++: add assert_main_thread to public functions in the Window
Some have it some don't. Just add it everywhere.

See https://github.com/slint-ui/slint/discussions/5762
2024-08-06 22:52:45 +02:00
Simon Hausmann
8a7db55bb6
Route debug() calls in Slint consistently through Platform's debug_log() (#5718) 2024-07-29 16:31:09 +02:00
Olivier Goffart
5f78b599cf esp-idf README: fix compilation of the code sample
- `touch_handle` can't be initialized with an optional anymore, it is a
   pointer.
 - Take the opportunity to actually initialize the touch handle.
 - `bsp/display.h` for the box3 fails to compiled if it is included
   before `bsp/esp-bsp.h`
2024-07-24 22:57:57 +02:00
ogoffart
aa25e3cd44 Bump version number to 1.7.1 2024-07-23 12:05:34 +00:00
Simon Hausmann
e36eb6aba6 Document behaviour of globals when exporting multiple components
Fixes #5467
2024-07-18 13:43:13 +02:00
Simon Hausmann
c5f7c38914 esp-idf: Silence compilation warning by avoiding deprecated syntax 2024-07-17 10:41:34 +02:00
Simon Hausmann
bda89c25da Document that availability of slint::testing is conditional to enabling the feature and experimental features. 2024-07-11 11:47:09 +02:00
Simon Hausmann
2be4b320b9 C++: Include AccessibleRole in the slint::testing namespace docs 2024-07-11 11:47:09 +02:00
Simon Hausmann
27dc6e53c0
API review: enable all features in the C++ docs (#5592)
And make sure that functions excluded when freestanding is enabled are included in the docs.
2024-07-11 08:29:51 +02:00
Simon Hausmann
bc1ada20bd Revert "C++: Enable software renderer by default"
This reverts commit 42571bbddb.

The line-by-line renderer doesn't compile with xcode 15.4,
and TestWindowAdapter doesn't compile with gcc 10 in the linux CI.
2024-07-10 22:39:20 +02:00
Simon Hausmann
42571bbddb
C++: Enable software renderer by default
It's also enabled by default in the rust crates and the tools.
2024-07-10 22:19:20 +02:00
Olivier Goffart
e67e46ab47 LLR: merge the popup's x and y property access in one expression 2024-07-10 17:54:03 +02:00
Simon Hausmann
419042f476 Add support for using own properties in PopupWindow's x and y properties
This allows positioning popup windows in a way that takes their width/height into account.
2024-07-10 13:43:41 +02:00
Olivier Goffart
42d7661ec6 C++: make the PhysicalRegion::rectangles non-overlapping 2024-07-10 10:58:27 +02:00
Simon Hausmann
6750a454c1 Rename touch and panel to touch_handle and panel_handle and document their nullptr values 2024-07-08 21:36:47 +02:00
Simon Hausmann
4c432c261d API review (esp-idf): Replace the use of std::optional<esp_lcd_touch_handle_t> with esp_lcd_touch_handle_t directly
esp_lcd_touch_handle_t is a pointer, so might as well treat it like one.

Also default initialize the panel pointer.
2024-07-08 21:36:47 +02:00
Olivier Goffart
35a6e7bde5 Split Text item into SimpleText and ComplexText
SimpleText has all the most common properties and is half the size
2024-07-05 12:51:25 +02:00
Olivier Goffart
6b1c02be94 C++: document the SLINT_FEATURE_* macros 2024-07-05 12:50:05 +02:00
Simon Hausmann
6d79ca1a05 Document the SLINT_FEATURE_XXX pre-processor variables
and sync them with the existing features.
2024-07-04 13:39:13 +02:00
Simon Hausmann
7ab7dd63c5 Document SLINT_ENABLED/DISABLED_FEATURES target properties 2024-07-04 13:39:13 +02:00
Simon Hausmann
964de46c51 C++: Make the system testing feature automatically enable debug info
While we haven't settled on the debug info feature and are
merely controlling it via environment variable, setting that can be very hard - especially when using Yocto.

To make life easier, let's do in C++ what we can't easily do for Rust but would like to:

When enabling system testing, automatically emit the necessary debug info, by setting the environment variable when calling the compiler.

This is done by adding SLINT_ENABLED_FEATURES and SLINT_DISABLED_FEATURES properties
on the Slint::Slint target that - as lists - export the list of features and their status.

This way we can compile Slint in once place and safely in the CMake code running in application
scope check about the available features.
2024-07-04 13:39:13 +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
Arnold Loubriat
ce2db77e88
Add the accessible-placeholder-text property (#5464) 2024-06-26 12:59:22 +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
bf4afc5e15 Fix C++ build with renderer-skia enabled 2024-06-18 17:48:17 +02:00
Simon Hausmann
4c888bf1ae Port the Skia renderer to rwh06 and the new softbuffer
... by accepting an Rc<dyn Has*Handle> in the interface. This is required for softbuffer use.
2024-06-18 17:48:17 +02:00
Olivier Goffart
ffbd8a6bfb Fix C++ build breakage caused by changed in stringify! output in nightly Rust
The C++ build started failling with nightly rust:
https://github.com/rust-lang/rust/pull/125174 changed the output of
strignify! to contins more spaces between tokens, which we relied on to
perform some type substitution from Rust types to C++ types, resulting
in compilation errors:

```
build/api/cpp/generated_include/slint_builtin_structs_internal.h:71:5: error: ‘Option’ does not name a type
   71 |     Option < core :: ops :: Range < i32 >> replacement_range;
      |     ^~~~~~
build/api/cpp/generated_include/slint_builtin_structs_internal.h:75:14: error: ‘core’ was not declared in this scope
   75 |     Option < core :: ops :: Range < i32 >> preedit_selection;
      |              ^~~~
```

Workaround by cleaning whitespace before matching the types.
2024-06-15 14:43:14 +02:00
Olivier Goffart
d0cdebfee6 C++: move globals in a different struct
So that subcomponent don't depend on the root component name
which will hallow to have several root components
2024-06-14 16:26:53 +02:00
Olivier Goffart
2a5f093efc Janitor: C++: Fix warning about unused import 2024-06-13 17:34:57 +02:00
Olivier Goffart
4cc6337c42 Rust: Don't get the default font size through the root component
Planning for multi-component support
2024-06-13 13:53:07 +02:00
Simon Hausmann
4591ad8d57 Add plumbing for system testing 2024-06-13 04:03:17 -07:00
Simon Hausmann
5247b0afae
Add ElementHandle::accessible_role() to the C++ API (#5388) 2024-06-13 06:32:25 +02:00
Simon Hausmann
76e265c13c slint-esp: Remove rotation parameter from older slint_esp_init overload
Commit 88e1a366a3 stabilized the rotation support and commit 1378d6e3bc adds new API to select rotation in the esp-idf integration.

The previous rotation parameter was behind the experimental flag. Now that we have a "cleaner" API, we might as well remove the old experiment in favor of the newer API.
2024-06-11 04:05:28 -07:00
Simon Hausmann
1378d6e3bc
Make it possible to use slint-esp with displays that expect little endian ordered RGB565 pixels (#5344)
We can't automatically determine what the display supports, so we need to make this an opt-in - just like it is with LVGL.
2024-06-11 11:30:42 +02:00
Olivier Goffart
58826ddd94 Testing C++ API: add a visitor over the ElementHandle 2024-06-10 15:52:40 +02:00