Commit graph

498 commits

Author SHA1 Message Date
Simon Hausmann
dbabb33c45 Fix build of dependencies that use pkg-config when building Slint in buildroot
When building with cmake, buildroot sets PKG_CONFIG_SYSROOT_DIR in its
toolchain file, and therefore it's only available at configure time but
not build time, which is when our dependencies need it.
2023-10-05 09:39:04 +02:00
Simon Hausmann
0773e51d92 Improve file type for SLINT_COMPILER cmake cache variable
Use a FILEPATH to reflect that this is a path to a file and then the cmake configurator will
show a file dialog.
2023-10-02 13:15:20 +02:00
Olivier Goffart
d688f37ee8 Change alias to the native style depending on the platform
Fixes #3431
2023-09-29 17:05:10 +02:00
Simon Hausmann
87a548a972 Fix cross-compilation with a Yocto SDK
Since commit 7947f233f1a744f5ce9dfdf44372727d4fefb50b in Corrosion,
cmake will default to ${CMAKE_C_COMPILER} for linking a cdylib,
which means that C must be enabled as a language in the project.

Previously, it tried C, CXX, and Fortran and picked the first one.
2023-09-29 12:03:40 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
Olivier Goffart
36f43d535f fix typo in esp-idf README
Also lists in lists don't render well on components.espressif.com, so
don't use two level of numbers
2023-09-22 09:07:25 +02:00
Olivier Goffart
855cc025b0 esp-idf README: add information about missing stack or RAM 2023-09-19 12:51:35 +02:00
Simon Hausmann
55b2ff280d Troubleshoot Slint for ESP-IDF on Windows 2023-09-19 12:28:00 +02:00
Olivier Goffart
14f7fe4ba2
cmake: add flags to only build the compiler
... and to use an external compiler

For example, this is how one only build the compiler:

```
cmake .. -DSLINT_BUILD_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=/tmp/slint_compiler
make install
```

And this only build the runtime
```
cmake .. -DSLINT_FEATURE_COMPILER=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install_runtime
make install
```

And then this can be used in a project like so:
```
cmake .. -DCMAKE_PREFIX_PATH=/tmp/install_runtime/ -DSLINT_COMPILER=/tmp/install_compiler/bin/slint-compiler
```
2023-09-15 14:42:52 +02:00
Olivier Goffart
e0fd9a6105 WIP: Add item_geometry to the ComponentVTable
(unused yet)
2023-09-13 16:08:37 +02:00
Olivier Goffart
8f61f1c2a7 Update esp deps 2023-09-13 14:33:44 +02:00
Olivier Goffart
5d37a4a158 Update to corrosion 0.4.3
That include a fix for parsing espressif target so workaround can be
removed
2023-09-13 11:36:46 +02:00
Simon Hausmann
8b478431a7 Help the Skia build to find clang
..even if cmake sets CC/CXX to GCC.
2023-09-13 10:11:39 +02:00
Simon Hausmann
c8b05c2b05 Add documentation about the different renderers, their pros/const, and availability in backends and API 2023-09-12 11:28:17 +02:00
Simon Hausmann
3652f58a3f Change item indices from usize to u32
So that the compiler and run-time can never disagree on the
number of bytes the item index can use.
2023-09-12 08:53:58 +02:00
Simon Hausmann
090665de13 Remove traces of required C++ exception support
After commit cf19749943 this isn't needed anymore.
2023-09-07 11:32:56 +02:00
Olivier Goffart
cf19749943
Make a pass to remove the Expression::Return instruction
So it doesn't appear in the LLR and the C++ codegen can be simplified.
In particular, this removes the need to throw/catch exception to handle return
across generated lambdas
2023-09-06 14:10:26 +02:00
Olivier Goffart
a565ed53fd Upgrade MSRV to 1.70
Many of our dependencies already made the jump and require a cargo update hack, so make it official

Removed the MSRV from the README since it applies to master branch and people read the readme also for
the released version. There is enough documentation of the MSRV in other locations.
2023-09-06 12:09:03 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Simon Hausmann
c5135ab46c Fix esp-idf component upload
Bump component revision to 1 (from default zero)
2023-09-04 13:31:35 +02:00
Simon Hausmann
c92c554da9 Prepare esp-idf component for release
- Remove the alpha suffix
- Use Slint from the release tag not the branch.
  It would be awkward if the 1.2.0 esp-idf component would end up
  using Slint 1.3.0, so let's tie them together for now.
2023-09-04 10:24:50 +02:00
Simon Hausmann
2a486edd82 Mark the linuxkms backend as experimental 2023-08-31 11:30:51 +02:00
Olivier Goffart
8f16b519a2 use #repr(uX) instead of repr(C) for fieldless enums
Otherwise the ABI may differ between the C++ and the Rust
2023-08-31 10:22:03 +02:00
Simon Hausmann
9a94c8869e Release esp-idf component once more before 1.2 release
... to catch up with API changes that the platform.cpp required changes to.
2023-08-30 16:32:32 +02:00
Olivier Goffart
73ff86cf5a C++: Move the PhysicalRegion in the SofwtareRenderer 2023-08-30 14:59:41 +02:00
Olivier Goffart
932db7ac38 C++: make Platform::duration_since_start non-const and pure
When SLINT_FEATURE_FREESTANDING is set, it must be re-implemented
otherwise the time doesn't pass
2023-08-30 14:59:41 +02:00
Olivier Goffart
c47e6cd029 C++: Api changes in the WindowAdapter
- s/physical_size/size/ (consistant with the slint::Window API)
 - remove const of virtual function  (they don't need to be const and
   make implementation potentially easier)
 - Move the WindowProperties in it
2023-08-30 14:59:41 +02:00
Simon Hausmann
465fe20478 Fix external links from the C++ docs in markdown files
Recgonize the default schemes, otherwise
myst-parser thinks they're internal.
2023-08-30 14:58:31 +02:00
Olivier Goffart
fd60d08f7b Rename SLINT_TARGET_CARGO_FLAGS to SLINT_LIBRARY_CARGO_FLAGS 2023-08-30 13:44:19 +02:00
Olivier Goffart
e46704465b C++: DEPFILE is supported on most generator in recent cmake versions 2023-08-30 09:54:03 +02:00
Olivier Goffart
de0836d1a0 C++: Fix ninja always rebuilding the .slint file
two bugs:
 - If the .slint file did not contain any import, the depfile would have
   no dependencies, and as a result, ninja would consider that it is
   always dirty.
 - In case the binary dir is a sub directory, the dependencies were
   relative to the wrong directory. Thgis is because the behavior
   changed in some version of cmake (see https://cmake.org/cmake/help/latest/policy/CMP0116.html)
   to avoid any problem, use the absolute paths

Fixes #3261
2023-08-30 09:54:03 +02:00
Simon Hausmann
040019c7b6
doc: Fix link to set_physical_size 2023-08-29 07:02:31 +02:00
Simon Hausmann
d160eb7a31
Add support for set_position(), position(), and set_physical_size() to the C++ WindowAdapter (#3367)
Closes #3349
2023-08-28 18:43:04 +02:00
Simon Hausmann
42721c1853 Fix no_std build 2023-08-28 15:20:17 +02:00
Olivier Goffart
ded66231d1 C++: polish the clipboard patch
- make sure the Platform::Clipboard type is properly documented
 - Use the actual enum in the interface (even though it is
   #[non_exhaustive] so we need to slience a warning)

CC: #3265
2023-08-28 14:34:23 +02:00
Simon Hausmann
67423b288f Add documentation to the WindowAdapters to explain the basic message passing protocol
... and provide hints in there about implementing window close requests.

Note: The links to set_size() and set_position() are not resolved, as
these virtual functions are still missing from the WindowAdapter base
class.
2023-08-28 13:45:28 +02:00
Simon Hausmann
11128b3b7f Document show()/hide()'s behavior of the additional strong component reference 2023-08-28 13:45:28 +02:00
Ian McFarlane
1de7b1512c
Expose clipboard_text accessors to C++ (#3265) 2023-08-28 12:26:40 +02:00
Olivier Goffart
d23ba885ca
C++: add WindowAdaptor::update_window_properties 2023-08-25 13:58:55 +02:00
Simon Hausmann
e7a883348b Add links from Rust and C++ to the common platform backend docs
... and adjust the C++ platform backend docs a little to the current
state.

cc #3208
2023-08-25 13:22:06 +02:00
Olivier Goffart
5052aa8561 Remove clap dependency of cbindgen
we don't use it, and clap used by cbindgen is an old version resulting
in duplicate clap versions being built
2023-08-25 10:51:59 +02:00
Olivier Goffart
7904493e1c C++: dispatch close request and activation change 2023-08-24 17:27:04 +02:00
Olivier Goffart
725a259e3a
C++: move the window related stuff in its own header (#3339)
slint.h starts to be quite big, and lots of it is because of Window, so
move Window to its own header
2023-08-24 15:51:50 +02:00
Olivier Goffart
541e7137c6
Backends: don't resize the WindowItem in set_visible
We already query the size right after the call to set_visible in the
WindowInner::show()
2023-08-24 13:15:28 +02:00
Simon Hausmann
06fce57e8e First draft for new getting-started instructions for the ESP-IDF component 2023-08-24 08:59:46 +02:00
Simon Hausmann
abdf4eb169 Bump esp-idf component version
So I can test the instructions against what's public :)
2023-08-22 15:51:38 +02:00
Olivier Goffart
f611091470 C++ docs: don't use backtick for Class or method name
because otherwise doxygen don't make links

(also implements the `renderer()` funciton in the doc example)
2023-08-22 11:29:57 +02:00
Olivier Goffart
3e46680c16
C++: improve slint::platform docs (#3319) 2023-08-22 11:24:30 +02:00
Olivier Goffart
8a124cdcdd esp-idf: improve docs 2023-08-21 17:59:19 +02:00