Simon Hausmann
83ccd07a88
C++: Add slint::Window::scale_factor() getter ( #3004 )
...
Fixes #3003
2023-06-28 13:24:40 +02:00
Simon Hausmann
d1daa8dbe4
doc: Document coordinate system expectations for borrowed textures
2023-06-26 12:49:22 +02:00
Simon Hausmann
aa41277df1
Improve safety notes on the slint::Image texture import functions
...
Elaborate how to call this function safely, and copy the same description to the C++ docs.
2023-06-22 22:31:51 +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
cd9994306e
Create the window adapter lazily in C++
2023-06-13 15:13:42 +02:00
Olivier Goffart
12e6b34e2d
Translations: support for plurals
2023-06-07 10:34:34 +02:00
Olivier Goffart
723a4477d6
C++: prospective fix for warning in CI on windows
2023-06-06 14:23:02 +02:00
Olivier Goffart
cf746ddf8d
WIP: formatting implementation of translate in rust and C++
2023-06-05 16:34:59 +02:00
Simon Hausmann
0f54b9599b
Add support for manually closing PopupWindows
...
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
2023-06-02 18:07:49 +02:00
Olivier Goffart
f7e61fdd37
Fix transparentize to multiply by 1-factor
...
Also add `[[nodicard]]` in C++
2023-06-02 17:02:08 +02:00
Olivier Goffart
5599bd44e0
Remove Color::opaque
...
It is not a right name and i don't think it is a so common operation
2023-06-02 17:02:08 +02:00
Olivier Goffart
4845241ebf
Rename translucent to transparentize and mixed to mix
2023-06-02 17:02:08 +02:00
Arthur Araruna
64ad1ce357
Add some color and brush manipulation funcs ( #2565 )
...
The added functions enable mixing colors and manipulating the opacity
of colors and brushes.
They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
2023-06-02 17:02:08 +02:00
Simon Hausmann
c428601370
Add support for select-all(), cut(), copy() and paste() functions on text input elements ( #2804 )
...
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.
Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
2023-06-01 16:04:53 +02:00
Simon Hausmann
e7320607a3
Remove BorrowedOpenGLTexture from the public API again and just provide a factory function in slint::Image
2023-06-01 15:56:55 +02:00
Simon Hausmann
084ff70079
C++: Improve reliability of comparison operator of slint::Image
...
Call into the Rust implementation, so that we have to maintain only one
implementation.
2023-06-01 15:56:55 +02:00
Simon Hausmann
f51ca82f10
Add C++ API and example for borrowing OpenGL textures
2023-06-01 15:56:55 +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
b47936d4cd
Make AbstractRenderer functions private in the sub-class
2023-05-21 14:40:43 +02:00
Simon Hausmann
289883ccc0
Replace access to raw WindowAdapterRcOpaque with friend declarations
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
b27163954a
Fix build of experimental C++ platform API on Linux
2023-05-17 12:41:37 +02:00
Olivier Goffart
422bcc3a4a
C++: optimize SharedVector's iterator constructor
...
Don't detach for every element.
Closes #2737
2023-05-17 09:23:17 +02:00
Simon Hausmann
185334d5e7
Fix doc comment
2023-05-11 10:42:09 +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
0475b91daf
skia: Simplify renderer API
...
Remove the generic window handle owner part of the API. Instead assume
that the caller provides safety for the given window handles, like we do
for FemtoVG and like softbuffer does it in its public API.
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
Simon Hausmann
77645d9908
C++: Warn when the return value of slint::Image::load_from_path
is not used
...
Somebody recently accidentally wrote this code:
```cpp
slint::Image image;
image.load_from_path(...);
```
and that should have produced a warning.
2023-05-10 11:46:00 +02:00
Simon Hausmann
c6c6564537
Fix C++ formatting
2023-04-24 18:02:55 +02:00
Simon Hausmann
0ba6ef1c24
Fix build against macOS deployment target 10.10
...
- std::optional<T>::value() is not available, use operator * instead
- alignment allocation is also only available in 10.14 or newer
2023-04-24 18:02:55 +02:00
Simon Hausmann
4d502a9f96
Add a C++ version of the Virtual Keyboard example
2023-04-14 11:39:02 +02:00
Olivier Goffart
a57c7eb6bc
Added TextInputInterface.text-input-focused
2023-04-12 14:49:08 +02:00
Olivier Goffart
fd3f974d7e
Don't use old syntax in docs
2023-04-06 17:06:46 +02:00
Simon Hausmann
e3800fd3c3
Fix incorrectly rendered C++ docs code fence
2023-03-24 20:39:27 +01:00
Tobias Hunger
da95051db1
docs: Fix dead links between docs
...
... and add in text that went missing in the Globals section of the rust
docs.
2023-03-23 11:22:51 +01:00
Olivier Goffart
c82bb1515e
C++ image: add some docs
...
Note: Don't use cbindgen to generate `operator==` for public types.
Because it doesn't have docs and the documentation show warnings
otherwise
2023-03-20 17:22:56 +01:00
Olivier Goffart
ef7fb6422a
C++ Image API: introduce the SharedPixelBuffer
2023-03-20 17:22:56 +01:00
Olivier Goffart
be47c8464c
C++: implement creation of image from raw data
...
Issue #616
2023-03-20 17:22:56 +01:00
Tobias Hunger
9af756bf3f
cpp: Do not produce warnings when using the UIntModel
2023-03-06 17:03:20 +01:00
Simon Hausmann
aba5797eaa
C++ docs: Elaborate a little on the argument to Window::set_rendering_notifier
2023-02-17 11:12:54 +01:00
Olivier Goffart
a19efc30db
Replace the MAX_BUFFER_AGE const generic with a runtime enum
...
Having a const generic for that didn't turn to be a good API.
Also made the C++ side more difficult
(Also renamed buffer_stride to pixel_stride)
Closes #2135
2023-02-08 14:44:01 +01:00
Olivier Goffart
eaa9db4911
C++: use size_t everywhere as index in our models
...
cc #2024
2023-02-07 15:25:44 +01:00
Olivier Goffart
63cc68ea0c
C++: Use concepts for the invokables
2023-01-26 11:35:16 +01:00
Olivier Goffart
a3ec320bfb
Remove some deprecated stuff
...
CC #2024
2023-01-26 11:19:21 +01:00
Simon Hausmann
629c7ed80e
Remove undocumented and dysfunctional PathLayout
...
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
2023-01-21 13:10:19 +01:00