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
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
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
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
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 ( #2994 )
2023-07-10 10:12:11 +02:00
Olivier Goffart
11dea135f7
Domain: slint-ui.com -> slint.dev
2023-06-16 10:55:08 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs ( #2888 )
2023-06-15 11:20:50 +02:00
Simon Hausmann
599d86e4e1
Simplify Skia renderer API
...
Remove the size argument from render().
2023-05-26 10:46:59 +02:00
Simon Hausmann
dd61890e23
Fix rendering of the Qt platform example with high-dpi
...
- Provide a C++ platform event for the scale factor change and send it
- Report the correct logical and physical sizes to Slint
2023-05-25 05:29:52 +02:00
Simon Hausmann
ef4074b041
Further simplify renderer storage in C++ platform API
...
Using an std::optional is even simpler and avoids a malloc.
2023-05-21 14:40:43 +02:00
Simon Hausmann
baba30370a
Simplify C++ WindowAdapter <> Renderer interface further
...
Instead of the WindowAdapter being a template for a concept, let's just
use an abstract base class for the renderer. Since we provide the
renderers, this simplifies two things:
- Ownership becomes clear to the user by creating the renderer instance
in a field of theirs.
- All template use goes away on the user side.
2023-05-21 14:40:43 +02:00
Simon Hausmann
fe4a434ce4
Remove the WindowAdapter from the renderer constructor
...
This allows disentangling the native window creation from the renderer
creation, which is rather ugly and complicated on the C++ side.
2023-05-21 14:40:43 +02:00
Olivier Goffart
dd5ef9993f
Platform: Add a Resized event and use that to convey the changes in size ( #2759 )
2023-05-21 12:12:30 +02:00
Simon Hausmann
3db5b97790
Fix the Qt native platform example
...
Fix regression introduced with commit d0cdc462c7
:
The window surface must exists before querying for the window handles.
2023-05-17 14:59:16 +02:00
Simon Hausmann
b27163954a
Fix build of experimental C++ platform API on Linux
2023-05-17 12:41:37 +02:00
Simon Hausmann
3340c31249
Clean up C++ experimental native window handle API
...
- Use explicit constructor functions
- Box the implementation
2023-05-11 10:42:09 +02:00
Simon Hausmann
d0cdc462c7
Simplify Skia Renderer
...
Allocate the renderer's surface type in the constructor.
This also changes the C++ API to match this, which complicates some code
a little bit.
2023-05-11 10:42:09 +02:00
Olivier Goffart
ae20ec59c8
Rename PointerEventButton::None to PointerEventButton::Other
...
And mark the enum non_exhaustive
closes #1903
2023-01-26 13:36:54 +01:00
Olivier Goffart
8967deef56
C++: add a manual test to test the platform API using Qt
2023-01-17 10:21:11 +01:00