Commit graph

64 commits

Author SHA1 Message Date
ogoffart
e7f48512ee Bump version number to 1.0.0 2023-02-03 11:07:15 +01:00
Olivier Goffart
83ea50761a Janitor: upgrade corrosion 2023-01-19 11:48:28 +01:00
Olivier Goffart
8d0cdc6ec2 C++: cmake: move the build instruction for the tests in the tests dir 2023-01-17 10:21:11 +01:00
ogoffart
ce07d078ce Bump version number to 0.3.4 2022-12-16 09:36:15 +00:00
Simon Hausmann
c4d5f079b5 Partial fix for cmake build with Skia against Yocto
Latest corrosion handles quoting differently and would escape the empty quoted
string, so pass an empty string instead, for the host cflags.
2022-12-14 11:40:03 +01:00
Simon Hausmann
a63c7bcada Use the fresh new corrosion release 2022-12-13 12:10:16 +01:00
Simon Hausmann
61dc5e31b4 Fix running of tests with multi-config generators
Now that the binaries are placed in their respective
CMAKE_RUNTIME_OUTPUT_DIRECTORY, that's config suffixed, let's use the
ctest signature that accepts a cmake target and thus automatically
figures out the correct location of the executable.
2022-12-13 11:39:34 +01:00
Simon Hausmann
3e5aa212d5 Remove workaround for slint DLL placement for examples
We can now use the standard CMake variables to make sure that a copy of
the DLL lands next to the executables for Windows.
2022-12-13 11:39:34 +01:00
Simon Hausmann
53b05c426c Upgrade corrision to a git snapshot
This includes support for placing build artefacts into output directories
using standard cmake variables.
2022-12-13 11:39:34 +01:00
Olivier Goffart
8d686637f4
Experimental platform API from C++ 2022-12-12 12:54:31 +01:00
Simon Hausmann
7e77a2a4cc Bump MSRV to 1.64
... due to rust-skia bindings requiring a feature (ffi related).
2022-12-04 19:39:35 +01:00
ogoffart
fb02b4118b Bump version number to 0.3.3 2022-11-28 13:11:11 +00:00
Simon Hausmann
4308ed921d
Add documentation about the available widget styles and how to select them (#1910) 2022-11-25 14:53:20 +01:00
Simon Hausmann
e9db914fb1
Add is_visible to NodeJS and C++ Window types (#1816)
Amends commit 82278a5742
2022-11-04 16:24:24 +01:00
Jonathan Schwender
4ade9faa0d Update Corrosion to v0.3
This requires the following changes:
- Delay configuring SlintConfig.cmake:
  Corrosion sets the `IMPORTED` locations late to allow us to set
  OUTPUT_DIRECTORY target properties. The configuration of
  SlintConfig.cmake must be deferred until after Corrosion set the
  locations. Since we are writing to a config file Generator expressions
  are not an option.
- Remove BUILD_TYPE mapping from SlintConfig.cmake:
  As discussed in https://github.com/slint-ui/slint/pull/1785#issuecomment-1294630845
  remove the mapping of the build types since corrosion now always sets
  the `IMPORTED_LOCATION` property.

User facing improvements enabled by the update:
- Corrosion will not fail anymore if the user has a Rust toolchain >=1.60
  installed, but the default toolchain is < 1.60.
- Corrosion will respect OUTPUT_DIRECTORY properties and move target
  artifacts to the expected locations
2022-11-02 21:38:39 +01:00
ogoffart
2171773a3e Bump version number to 0.3.2 2022-10-28 09:30:14 +00:00
Olivier Goffart
0ba468c236 Use a builtin function to access the dark-style
instead of a property on NativeStyleMetrics
2022-10-19 15:23:41 +02:00
Simon Hausmann
5b95466fa6
Add a C++ Filter Model class (#1685)
Add a C++ Filter Model class

This matches the FilterModel in the Rust API.
2022-09-27 10:24:47 +02:00
Simon Hausmann
a24c33b8ea Fix Yocto cross build
After renaming the features, the if conditions need to be adjusted.
2022-09-23 14:12:21 +02:00
Simon Hausmann
f54cebf3d6 Don't build Skia with CMake by default
We also don't build it with Cargo by default
2022-09-22 12:56:18 +02:00
ogoffart
261614b914 Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
Olivier Goffart
8850959a2c Rename the backend feature flags 2022-09-07 17:11:57 +02:00
ogoffart
05a49da906 Bump version number to 0.3.0 2022-09-06 13:00:22 +02:00
Simon Hausmann
3a1817de3f Skia: Make it possible to explicitly select the OpenGL backend of Skia
When opting into the Skia renderer, we default to metal on macOS and D3D on Windows.
However if you want to develop a cross-platform application with Skia and
for example rely on OpenGL to be able to implement an OpenGL underlay or overlay,
then we need the ability to explicitly opt into skia's GL renderer.

cc #1445
2022-09-05 14:07:27 +02:00
Olivier Goffart
5900ec3373 Janitor: update corrosion 2022-09-01 14:03:46 +02:00
Simon Hausmann
a7121a6177 Remove erroneous mention of SLINT_FEATURE_EVENTLOOP_WINIT_ALL
We used to have SLINT_FEATURE_BACKEND_GL_ALL, but when we introduced the
renderer and event loop distinction in the features, we removed the "all" suffix from
the event loop that includes x11 and wayland support.
2022-09-01 11:25:49 +02:00
Simon Hausmann
c69437fe8f Fix build of CMake package inside Yocto build
When building against a Yocto SDK, CFLAGS isn't set, only CC. When
building inside Yocto, CC is set to just the target compiler and CFLAGS
contains the target specific options. Just like with commit
5bc56a3924 we need to cover also
HOST_CFLAGS by making them empty.
2022-08-19 17:02:30 +02:00
Simon Hausmann
5bc56a3924 Fix Skia cross-build when using CMake
This requires a creative workaround :-)
2022-08-04 16:41:26 +02:00
Simon Hausmann
771b122198 Add skia renderer skeleton
This one can render basically just plain rectangles.
2022-08-02 12:00:56 +02:00
Simon Hausmann
70a753756d Fix cmake compat options
Use option() directly, not propagate that into the cpp crate
2022-07-26 17:43:51 +02:00
Simon Hausmann
b47eb8507a Remove the rtti-winit and rtti-qt features
These are not needed anymore, as the selector can enable the respective rtti features
in the winit and gl crate when its own rtti features is enabled.
2022-07-26 17:43:51 +02:00
Simon Hausmann
3619989fcc Rename backend feature flags to accomodate more renderers
Split backend-gl-* into eventloop-winit-* and renderer-femtovg.

The old feature names are still available.

For consistency eventloop-qt and renderer-qt are aliases for backend-qt.
2022-07-26 17:43:51 +02:00
Simon Hausmann
27bf9348e6 Rename the backend-gl crate into backend-winit 2022-07-26 17:43:51 +02:00
Simon Hausmann
fe3d4b7177 Bump MSRV to 1.60 2022-07-26 09:20:52 +02:00
Olivier Goffart
29d28dc73e C++: don't force the SLINT_STYLE cmake variable
Keep the default if unset, otherwise use whatever SLINT_STYLE was passed
2022-07-20 12:18:18 +02:00
ogoffart
6b15d2e479 Bump version number to 0.2.6 2022-07-06 09:58:14 +00:00
Olivier Goffart
66c443c90c Add the rust-version field to make the MRSV explicit
We changed the MSRV in the last release because some dependency depended on
Rust 1.59. But that did not concern the C++ build, for example.
Now that we rely on rust 1.59 in our own code, we should make it explicit
so that the compilation error show the proper error
2022-05-20 08:18:11 +02:00
ogoffart
3709ded44d Bump version number to 0.2.5 2022-05-09 16:16:00 +00:00
ogoffart
c160ec2aef Bump version number to 0.2.4 2022-05-09 13:49:25 +00:00
Olivier Goffart
2aaefa8e0d C++: Setting a value to a property having a binding should always clear the binding
... even if the old value holds the same value as the new value

This fixes test_cpp_bindings_two_way_priority_default

Also add a C++ unit test that tests the Property type specificaly
2022-05-09 09:30:01 +02:00
Olivier Goffart
51146eccd1 Update corrosion 2022-05-09 09:23:23 +02:00
Olivier Goffart
bc0f878799 Update corrosion 2022-05-05 08:54:32 +02:00
ogoffart
6395cdfc09 Bump version number to 0.2.3 2022-05-04 12:32:58 +00:00
Olivier Goffart
e85e69fda0
Declare .slint enum in one place in i-slint-common
This avoid repeating the enums both in the compiler and in
the runtime library, and register them in a bunch of other places.

So it should be easier to add enums and enum values

Since cbindgen doesn't see through the macro, generate the enum
manually
2022-04-14 19:17:48 +02:00
Simon Hausmann
df2d6442d4 Make it possible to disable the slint compiler from the CMake build
This isn't always needed, for example when using only the interpreter API,
and its dependency to native libraries on Linux (namely fontconfig) makes it difficult to cross-compile with
CMake.

While cargo is invoked correctly for the native binary build, the library search paths
coming from CMake will be target specific, not host specific.

So for now this provides a way of disabling the compiler.
2022-03-22 12:59:52 +01:00
Simon Hausmann
9b62b08ed6 Fix CMake setting DT_NEEDED to the absolute soname of libslint_cpp in apps
As per rust-lang/cargo#5045, cargo does not set soname on created
cdylibs. We use corrosion to import our .so into CMake, which ends up
passing the absolute path to the .so to the link line of the
application. Due to the lack of DT_SONAME, this means that DT_NEEDED of
the application contains the full path to libslint_cpp.so. This is
sub-optimal for example for building Yocto SDKs, the build paths should
not end up in the created binaries.

The library should be located using the linker's search paths and the
.so name. For convenience, the application can use rpath to extend those
search paths (and usually CMake already does that), but there is no need
to code the absolute path to the library.

Set the IMPORTED_NO_SONAME CMake variable to work around this.

This can be verified with the steps as in #1066.

Fixes #1066
2022-03-18 16:58:53 +01:00
ogoffart
7b50791db4 Bump version number to 0.2.2 2022-03-10 08:48:33 +00:00
Simon Hausmann
39a2290221
Build the backends without rtti unless needed (#1001)
* Build the backends without rtti unless needed

Only the interpreter needs the rtti generated code.

 * Since `SlintElement` emits `#[cfg(feature = "rtti")]` tokens, each
 crate using `SlintElement` needs to have an `rtti` feature.
 * The selector gets backend specific rtti selection features, in order
   for the interpreter to enable them.
* Enable rtti when building the C++ project with the interpreter enabled
2022-03-01 18:37:07 +01:00
n-raine
beda5aca07 Add dark style detection support for GL backend
With the help of dark-light crate this is now exposed as dark-style
boolean property in NativeStyleMetrics.

Co-authored-by: Olivier Goffart <olivier@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-03-01 16:41:20 +01:00
Olivier Goffart
ea2e91ece9 Upgrade Catch2
I get a compilation error otherwise

```
_deps/catch2-src/single_include/catch2/catch.hpp:10830:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10830 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
      |                                                          ^~~~~~~~~~~

```
2022-02-21 13:30:01 +01:00