Commit graph

871 commits

Author SHA1 Message Date
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
Simon Hausmann
88e1a366a3 Make rendering rotation a public feature of the software renderer
Fixes #5372
2024-06-10 05:24:48 -07:00
Simon Hausmann
650f19a33c Re-run clang-format with version 18 2024-06-10 02:25:40 -07:00
Olivier Goffart
a780dd4905 Testing: Fix duplicated accessibility element
This fix the C++ todo test that wasn't run because of a typo

When an element is optimized in another one, only the first one should
report the accessible properties. (because element with accessible
properties cannot be optimized so they are always the first)
2024-06-07 13:18:12 +02:00
Olivier Goffart
445802c46d date_time: simplification and cleanups 2024-06-06 09:03:50 +02: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
Simon Hausmann
37b63e4bd4 Add public API in the interpreter (Rust/C++) to obtain the list of functions 2024-06-05 14:06:10 -07:00
Simon Hausmann
6f2a6c3f09 CMake: Add support for LIBRARY_PATHS to slint_target_sources
This makes it possible to use component libraries with C++.
2024-06-05 11:07:12 -07:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02:00
Simon Hausmann
622991a627 Fix ElementHandle::find_by_element_id docs
Describe what an id is and provide an example.
2024-06-05 01:29:58 -07:00
Simon Hausmann
7af0e7ae7c Add C++ API for find_by_element_type_name 2024-06-05 01:29:58 -07:00
Simon Hausmann
a752851d0f Expose element type names and ids in Rust and C++ 2024-06-05 01:29:58 -07:00
Olivier Goffart
43a336b534 C++ part of element_ids
Simplify a bit the llr generation so that there is less code duplication
between Rust and C++
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
Simon Hausmann
623bae7732 Internalize hack for dynamic translations change so that it also works for Rust apps 2024-06-04 04:33:10 -07:00
Aurindam Jana
a9d8209ab1 Update License related info in FAQ and README 2024-06-01 02:39:33 +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
Montel Laurent
f63523f708
Add increase/decrease support test (#5224) 2024-05-14 10:40:12 +02:00
Montel Laurent
c37c9d4f26
Testing: Add minimum/maximum support (#5192) 2024-05-10 16:18:02 +02:00
Simon Hausmann
eb85b7d359 Fix reset() on MappedModel
Use the right target template mapped type.
2024-05-09 10:50:49 +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
Montel Laurent
f8f3316dc1
Allow to check checkable support (#5186) 2024-05-07 13:44:14 +02:00
Olivier Goffart
6c58f4f492
C++ testing: gate under the experimental feature 2024-05-03 10:49:25 +02:00
Olivier Goffart
80f37a3acf C++ ChangeTracker implementation 2024-05-02 22:25:53 +02:00