Commit graph

871 commits

Author SHA1 Message Date
Olivier Goffart
f3b2b5d457
Improve documentation of AbstractRenderer 2023-07-28 12:18:34 +02:00
Olivier Goffart
ecf3937518
C++: use a macro to define the EnabledFeatures struct
So that there shouldn't be more copy-paste mistakes
2023-07-28 12:18:12 +02:00
Olivier Goffart
fd7fc5ab9b C++, remove the experimental flag
The platform namespace is now always enabled.
2023-07-28 10:36:08 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
Olivier Goffart
c3bec089fe C++: Rename slint_platform.h -> slint-platform.h 2023-07-27 15:42:11 +02:00
Olivier Goffart
643512f60a C++: rename slint_intepreter.h to slint-interpreter.h 2023-07-27 15:42:11 +02:00
Olivier Goffart
49485dbf7d SoftwareRenderer: add API to construct and change the buffer type 2023-07-27 14:44:28 +02:00
Olivier Goffart
116648ffcf C++ Platform: remove the experimental namespace 2023-07-27 13:22:22 +02:00
Tobias Hunger
d47d52bf52 ItemVTable::init(...): Take an ItemRc so that the itan can know where in the Item Tree it is located 2023-07-27 12:04:16 +02:00
Olivier Goffart
136130781c Update corrosion 2023-07-27 10:39:51 +02:00
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