Olivier Goffart
3054ecfb71
C++ platform API: move the dispatch_* function on the Window like in rust
2023-07-26 16:03:05 +02:00
Simon Hausmann
af97435463
Replace show()/hide() in the WindowAdapter with set_visible(bool)
...
This makes for a smaller interface.
2023-07-26 13:53:45 +02:00
Simon Hausmann
835510c7f6
C++ platform API: Remove const qualified from request_redraw()
2023-07-26 13:25:36 +02:00
Olivier Goffart
51d8a15164
C++ platform: make the max_buffer_age an enum
...
Copying the Rust enum instead of using cbindgen because we would need to
create a new header just for it for bublic types generated in the
platform namespace. I've also put it in the SoftwareRenderer class since
the equivalent enum is in the software_renderer module in Rust.
2023-07-26 11:28:45 +02:00
Simon Hausmann
f15bc6147e
Simplify FemtoVG and Skia renderer APIs: remove resize()
...
We can convey the new physical window size from the run-time
through the private renderer API
when a window resize event is dispatched.
2023-07-25 19:33:26 +02:00
Simon Hausmann
68a255b1d2
C++: Make the SkiaRenderer constructor explicit
...
As discussed in API review
2023-07-25 19:16:44 +02:00
Olivier Goffart
69a11f7dbc
C++: Platform::register_platform -> platform::set_platform
2023-07-25 17:38:20 +02:00
Olivier Goffart
42bb2bf705
C++: some changes to the Platform API
2023-07-25 17:38:20 +02:00
Simon Hausmann
7d136b6568
Remove the window parameter from the render() function of all the renderers
...
This makes for a slimmer API and instead we can create the renderer <-> window association
behind the scenes ourselves,
in set_component.
2023-07-25 17:28:08 +02:00
Simon Hausmann
507428b03e
Simplify FemtoVG and Skia renderer API ( #3153 )
...
Fold show() into the first time render() is invoked,
and hide() into the Drop implementation.
2023-07-25 17:17:40 +02:00
Olivier Goffart
2a56e25788
C++: rename PlatformEvent to Platform::Task
2023-07-25 16:15:35 +02:00
Olivier Goffart
3137bfe775
C++ Rgb565Pixel
2023-07-25 15:24:59 +02:00
Simon Hausmann
7893ec3fd4
C++: Improve type-safety of NativeWindowHandle API on macOS
...
Replace void* with forward-declared NSView/NSWindow in NativeWindowHandle::from_appkit
2023-07-25 15:19:56 +02:00
Olivier Goffart
3a2359f107
C++ Pointer dispatch API
2023-07-25 14:03:40 +02:00
ogoffart
aebaa7d6c9
Bump version number to 1.2.0
2023-07-25 10:44:53 +00:00
Simon Hausmann
5c0d88b71e
C++: Rename SoftwareRenderer::render_rgb565 to just render() and overload the Rgb8Pixel variant
2023-07-24 14:25:49 +02:00
Olivier Goffart
ed0e4726d1
C++: use esp-backtrace as a panic handler on the esp platform
2023-07-24 12:20:51 +02:00
Florian Blasius
8ce2620aaa
Added cpp ReverseModel ( #3132 )
2023-07-24 11:32:45 +02:00
Olivier Goffart
3a420d5769
C++ platform: return the updated region from the render function
2023-07-24 09:44:36 +02:00
Simon Hausmann
e9286c1189
Make it possible to build the slint-cpp crate as a static library
...
This isn't supported on desktop yet, but on MCU it is.
Cargo is instructed to build a dylib and a staticlib, but corrosion
instructs rustc to build only either dylib or staticlib.
Corrosion listens to the BUILD_SHARED_LIBS option and will change the
default for the Slint::Slint INTERFACE_LINK_LIBRARIES to either
slint-cpp-shared or slint-cpp-static. This way the selection is
transparent to the users.
2023-07-21 18:32:45 +02:00
Olivier Goffart
422c39d321
C++ Don't use aligned_malloc because we can't rely on that in esp-idf
...
Instead, try to do the alignment manually for over-aligned allocations
2023-07-21 17:14:43 +02:00
Simon Hausmann
cc36915241
Add RGB565 rendering function to the C++ software renderer
2023-07-21 09:16:20 +02:00
Simon Hausmann
917cecff85
Add support for embedding bitmap fonts in C++
2023-07-20 16:20:51 +02:00
Olivier Goffart
70978f88d2
C++: fix constructing zero-size slice with nullptr
...
We construct zero size slize from std::array in the generated code, and
std::array<T, 0> may have a nullptr as data. But Slice use a NonNull
internally.
2023-07-20 15:34:36 +02:00
Olivier Goffart
81bb6e2c70
C++ platform: duration_until_next_timer_update and change return type of duration_since_start
2023-07-20 10:58:33 +02:00
Olivier Goffart
de532d372a
C++ experimental platform event loop
2023-07-20 10:26:09 +02:00
Olivier Goffart
1805e6c4c1
C++: Make it working to have experimental withoud std
2023-07-18 13:54:59 +02:00
Olivier Goffart
7cffad2c3f
C++: add a STD feature enabled by default
2023-07-18 12:44:20 +02:00
Olivier Goffart
a1bf77383f
C++: Add a mechanism to #define features that are enabled ( #3103 )
2023-07-18 11:49:00 +02:00
Olivier Goffart
c269986af7
Delete slint_config.h.in
...
Was added by mistake in the previous commit
2023-07-17 22:24:55 +02:00
Olivier Goffart
9f214580a6
Add some changelog entries
2023-07-17 20:29:18 +02:00
Simon Hausmann
8f6669194a
Fix disapearing debugging techniques docs from C++ docs
...
Amends a11c4c42b0
2023-07-17 18:08:31 +02:00
Simon Hausmann
7961bd68e5
Fix inclusion of some C++ interpreter data structures C++ docs
...
Make sure to generate the public interpreter header file for the docs
xtask unconditionally.
2023-07-17 15:52:42 +02:00
Simon Hausmann
a8c07d64c5
doc: Fix grammar of slint_interpreter::ComponentDefinition::properties() C++ docs
2023-07-17 15:52:42 +02:00
Olivier Goffart
e7c306cf60
Add SLINT_TARGET_CARGO_FLAGS cmake variable
...
* Add SLINT_TARGET_CARGO_FLAGS cmake variable
2023-07-17 15:43:22 +02:00
Olivier Goffart
3fabff9a0c
C++ Platform: allow to override the duration_since_start
2023-07-14 16:12:12 +02:00
Olivier Goffart
008e60b530
C++: implement an allocator that use libc allocator when no_std
...
It is important to use the same heap, when there isn't a lot of
available memory
2023-07-14 16:12:12 +02:00
Simon Hausmann
06cb0e8703
Make in (theoretically) possible to run the qt platform example against a wayland compositor
...
This compiles but fails at run-time with
xdg_surface@24: error 3: xdg_surface has never been configured
2023-07-14 15:33:03 +02:00
Simon Hausmann
648680da6e
Fix qt platform example on X11
...
The "screen" native resource returns a xcb_screen_t pointer while the raw_window_handle's
XcbDisplayHandle::screen field is the screen number.
2023-07-14 15:33:03 +02:00
Simon Hausmann
3565023a15
Improve error handling in C++ Skia Renderer API
...
- Don't try to create a GLX context when we only have an XCB window handle,
XLib is required for that.
- Make it possible to create a NativeWindowHandle from Xlib data types.
Fixes #2978
2023-07-14 15:33:03 +02:00
Simon Hausmann
59d869cb84
Fix missing invocation of init() on Items with C++
...
In Rust, register_component in the run-time library is called unconditionally and
invokes init(). The window adapter is an optional
parameter.
In C++, we'd call register_component only if we had a window adapter, which meant
that we're missing init calls().
Amends cd9994306e
2023-07-14 13:09:45 +02:00
Simon Hausmann
64f1504ab9
Fix rendering of QStyle animations
...
Allocate a widget per NativeXXX. This way QStyleAnimation objects
created by Qt aren't shared among style options.
Fixes #2045
Fixes #2987
2023-07-14 13:09:45 +02:00
Olivier Goffart
4a505c6788
C++: Make the platform support work without the "std" feature
...
Add a experimental-platform feature that doesn't include skia
2023-07-14 10:46:21 +02:00
Simon Hausmann
d8fe052cde
Fix bad red markup in C++ slint::Model docs
...
Revert da95051
and fix the link in the substitution instead.
Fixes #2992
2023-07-10 10:13:42 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 ( #2994 )
2023-07-10 10:12:11 +02:00
Olivier Goffart
69567b49ef
C++: fix the signature of Size
...
otherwise compiler complains that "long unsigned int" != "int" on 32bit
2023-07-05 21:48:01 +02:00
Olivier Goffart
9112eaebfb
C++: don't use deprecated corrosion variable
2023-07-05 21:48:01 +02:00
Olivier Goffart
aa8ef4e302
C++: add a "std" feature to the slint-cpp crate
...
And make it no_std otherwise
This is a first step towards getting C++ on MCU (#2136 )
2023-07-05 21:48:01 +02:00
Olivier Goffart
9afadf50be
Get rid of the "use_modules" workaround
...
This doesn't seem to be needed anymore with newer rust version.
As long as one symbol from the crate is used, all exported function
from the crate are available.
The reason why some symbols in some module were gone was a bug in rust
that has been fixed, it seems
2023-07-05 13:41:06 +02:00
Olivier Goffart
2023ebc9a9
C++: Fix build with or without the interpeter feature
2023-07-05 09:54:03 +02:00