Add accessors to the information necessary to stitch together the
Component-wide ItemTrees (which include DynamicNodes) into one logical
tree of Items.
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.
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
Do not break building against slint using CMake from C++ when no
CMAKE_BUILD_TYPE was set when building Slint.
This just makes sure the build type is properly quoted, which makes sure
we keep a (empty) string token where CMake expects one.
Fixes: #1065
With ImageInner::StaticTextures (the variant) and StaticTextures (the
struct), we need to disambiguate for the generated enum contructor
functions. This is done by prefixing the enum variant with their name.
* 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
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>
- We need to make sure that the initialization of global is in the right order.
- In C++ and rust, we need to add accessor to the global component
- There can be `PropertyReference::Global` in binding of globals
- The interpreter globals need to hold references to the global they may depend on
Fixes#175
Also update a few more links and reference to slint in the readme
I know this means that we will have invalid links and instructions until the release,
but the instructions are already broken anyway
Fixes#909
Since we declare the struct in C++, we don't need to declare it in
rust for cbindgen anymore, as long as we expose the Size2D type from
euclid to the cbindgen_private namespace
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
Add the graphics state enum to the callback, too. When we add support for different backends,
it would be nice if it didn't require an API change.
It's duplicated from Rust
because it doesn't provide values. The WebLG one doesn't make sense for C++ and
the proc address closure isn't ffi safe.
(It could be manually bridged thought)
This API allows specifying a callback that will be invoked when setting
up graphics (great for compiling shaders), before rendering a frame (but
after the clearning of the surface background), after rendering a frame
(before swapbuffers) and when releasing graphics resources.