Simon Hausmann
7982325da4
Change Rectangle::background's type to be a brush
...
This also introduces the brush type in the compiler and generators. At the
moment only conversion from Color is implemented.
2021-02-03 12:49:44 +01:00
Olivier Goffart
d90fce9c1d
Generate linear gradient in C++
2021-02-03 10:16:23 +01:00
Simon Hausmann
40847a5563
Expose LinearGradientBrush also in C++
2021-02-02 08:44:53 +01:00
Olivier Goffart
54c979d9e6
Make it so that you don't need to run xtask through cargo
2021-02-02 08:39:06 +01:00
Simon Hausmann
9b1fd52231
Fix class vs. struct mismatch
2021-02-01 20:36:08 +01:00
Simon Hausmann
efb496fc25
Add C++ constructors for sixtyfps::Brush
2021-02-01 20:33:40 +01:00
Simon Hausmann
8c3ab3608a
Fix corrision build
...
Set CARGO_MANIFEST_DIR for the bindgen xtask as when run through cargo
2021-02-01 20:27:55 +01:00
Simon Hausmann
f33b26fa93
Make Brush compile for C++
...
A few changes were required:
* `LinearGradient(LinearGradient)` as enum variant unfortunately
won't compile because the cbindgen generated constructor
function (`LinearGradient()`) will try to also instantiate the
variant type inside (`LinearGradient`) and that won't find the type
but the function itself and error out. So the inner type is now
called `LinearGradientBrush`.
* The same name dance was required for `Color`, where the enum variant
instead is called `SolidColor`
* `BrushInner` was removed in favor of just `Brush`. The nicer Rust
API will be the public variant, and for cbindgen we can just put
the generated enum into an internal namespace, like we do for
Resource for example
* A `NoBrush` variant was added. Maybe that name could be improved?
2021-02-01 16:51:04 +01:00
Olivier Goffart
a36edfffbe
Change the C++ test API of the send_mouse_click
...
So that rust and C++ have the same code that can be copy pasted
2021-01-29 16:55:48 +01:00
Olivier Goffart
98d40e291d
Missing version update
2021-01-28 16:37:52 +01:00
Olivier Goffart
fea2478859
Update version number everywhere
2021-01-28 16:34:13 +01:00
Simon Hausmann
6a4f2aa572
Added the two missing path sub-elements for quadratic and cubic curves
2021-01-28 14:14:24 +01:00
Simon Hausmann
a6fbc4c05d
Add missing MoveTo
sub-element for Path
2021-01-28 13:16:25 +01:00
Olivier Goffart
647f7effcd
Add TextWrap and TextOverflow enum and corresponding property in Text
...
Although they ar enot working yet
2021-01-27 11:40:09 +01:00
Olivier Goffart
9de5af75ce
Allow FocusScope to reject the events
2021-01-26 17:05:31 +01:00
Olivier Goffart
2e23b5bbdd
Handle native callbacks with return value
2021-01-26 17:05:30 +01:00
Simon Hausmann
628e6fdb38
Add a BoxShadow element
...
This intends to provide a configurable rectangular "drop shadow". The
API is modeled after CSS/HTML5 Canvas where the element can be "bound"
to an existing rectangular shape (geometry and radius), the offset can
be used to place the shadow and color and blur configure the shadow.
The shadow's color fades into transparent.
TODO (in subsequent changes):
* Documentation
* Qt implementation
2021-01-26 13:56:12 +01:00
Olivier Goffart
0cb51a986f
Attempt to fix MSVC build
2021-01-26 13:47:34 +01:00
Olivier Goffart
802383cd6b
Propagate key event to parent if the item don't handle it
...
Does not work for C++ because binary compatibility issue
2021-01-26 13:17:04 +01:00
Olivier Goffart
c2982d9ab3
Add ability to get the parent item from the vtable
...
(still untested)
2021-01-26 10:36:37 +01:00
Olivier Goffart
5a21f1bd81
Rename emit_ to call_ for callback
...
Signal was renamed to Callback, but one does not emit a callback, one calls it
2021-01-25 15:59:10 +01:00
Olivier Goffart
c2dc0cef2c
Finish return statement handling
2021-01-25 15:32:00 +01:00
Simon Hausmann
2801e82658
Changed the KeyEvent in .60 to be an object
...
This exposes the text as well as the keyboard modifiers and is a little
more extensible.
2021-01-22 18:05:34 +01:00
Olivier Goffart
c7664f11ac
C++: operator== for VRc
2021-01-22 13:03:02 +01:00
Olivier Goffart
094287697a
Add a FocusScope
...
C++ part not working because the Callback with arguments are not yet supported with C++
2021-01-20 10:00:19 +01:00
Simon Hausmann
5f265ffc09
Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()
...
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.
As a bonus, the run() function on generated components is not consuming
anymore.
2021-01-19 09:50:22 +01:00
Olivier Goffart
dcb347fb7b
Move more functions from the GenericWindow to the Window
2021-01-15 15:02:55 +01:00
Olivier Goffart
090039094f
C++: rename component_type to static_vtable
...
Then there is no reference to "component" in vtable.h
2021-01-14 09:39:21 +01:00
Olivier Goffart
1bcf446078
Delete the VRcInner destructor in hope this silence a MSVC warning
2021-01-14 09:31:47 +01:00
Olivier Goffart
dfa25b96f7
Rename SharedArray to SharedVector
2020-12-18 10:26:07 +01:00
Olivier Goffart
0d2d48be4f
Rename "signal" to "callback"
2020-12-18 09:51:01 +01:00
Olivier Goffart
002cfa76af
Use PRIVATE in target_link_libraries
2020-12-16 14:29:12 +01:00
Simon Hausmann
1a3396da3b
Recommend the use of Ninja when using CMake
2020-12-15 18:28:24 +01:00
Olivier Goffart
5a7fa5bf11
Add an option to generate dependency file
...
For issue #135
2020-12-15 18:13:16 +01:00
Olivier Goffart
743b1da753
Make sure to re-run the compiler if the compiler changes
...
Fixes #131
2020-12-15 15:17:46 +01:00
Simon Hausmann
d7e7a6c2ac
Fix typo
2020-12-15 12:56:58 +01:00
Simon Hausmann
625978fe1a
WIP: Add an image-fit property to Image/ClippedImage
2020-12-15 10:26:54 +01:00
Olivier Goffart
63a0d9308b
Bump version
2020-12-14 08:49:54 +01:00
Olivier Goffart
a949570c57
Timer in C++
2020-12-10 13:08:58 +01:00
Simon Hausmann
36d897b81c
Bump GIT_TAG in the C++ integration
2020-12-09 15:37:29 +01:00
Olivier Goffart
125ec13f24
Bump version numbers
...
Note: this does not update the documentation yet
2020-12-07 15:41:29 +01:00
Olivier Goffart
f373d627fe
Update corrosion
2020-12-07 15:32:38 +01:00
Olivier Goffart
e73bbbcd10
More work on signal returning value
2020-12-01 18:47:49 +01:00
Olivier Goffart
564d6a0744
Fix Popup in C++
2020-12-01 10:24:37 +01:00
Olivier Goffart
8a64f10e84
Remove ComponentVtable::input_event
...
And the custom handling of the mouse grabber
2020-11-24 16:23:37 +01:00
Olivier Goffart
0c97b4f296
More use of the ItemRc
2020-11-24 13:42:34 +01:00
Simon Hausmann
3d85e45ec3
Add support for source clipping to the Image element
...
This allows rendering only a sub-rectangle of the original image, which
we can use right away in the sliding puzzle demo.
2020-11-23 15:46:59 +01:00
Olivier Goffart
596b740b62
Rename ARGBColor to RgbaColor
2020-11-23 11:47:47 +01:00
Olivier Goffart
08fe5f6c72
Add a Clip
2020-11-20 15:45:45 +01:00
Simon Hausmann
89e0b57627
Rework and simplify the focus handling
...
Instead of determining the focus item through item tree traversal and
pointer comparison and storing the intermediate indices in the
components in the tree, remember the focus item by a pair of
VWeak<ComponentVTable, Dyn> and item_index: usize.
This speeds up determining the focus item as well as delivering events,
which can now be done directly after retrieving an ItemRef with
get_item_ref.
This also fixes the duplicate line edit focus in the 7gui cells
test case.
2020-11-20 15:33:15 +01:00