Commit graph

1092 commits

Author SHA1 Message Date
Simon Hausmann
722b7d843e Added documentation for RenderingCache 2020-08-31 14:08:01 +02:00
Simon Hausmann
684b0cba58 Document HighLevelRenderingPrimitive 2020-08-31 13:55:41 +02:00
Simon Hausmann
3010a236e0 Add docs for RenderingPrimitivesBuilder, Frame and RenderingVariable 2020-08-31 13:37:37 +02:00
Simon Hausmann
5b6e951052 Document graphics::GraphicsBackend
More docs to come for the other classes, submitting this to reduce risk of conflicts.
2020-08-31 13:24:40 +02:00
Olivier Goffart
e7210d8d6c wasm: send an Exit event when the cursor leave the canvas
We do not get move or release event when the cursor is outside of the canvas
as a result, we would have no way of detecting that the mouse has been released
outside and we would be in a inconsistant state.

Fixes #19
2020-08-29 11:11:16 +02:00
Simon Hausmann
5dbd0b213c Add support for grid layout padding 2020-08-28 15:06:14 +02:00
Simon Hausmann
7976a4057f Improve handling of nested layouts
We support directly nested layouts, but we did not support indirect
nesting:

    GridLayout {
        Rectangle {
            l2 := GridLayout { ... }
        }
    }

This patch fixes that by detecting this scenario and merging the layout
info of the element (Rectangle) and the layout inside (l2). This makes
it much easier to create re-usable components that use layouts
themselves and allows placing them in layouts.
2020-08-28 15:06:14 +02:00
Simon Hausmann
4054402418 Fix layout info calculation for grid layouts
When the spacing was zero, the constraints would always be zero due to
accidental multiplication with the accumulated spacing widths/heights.
That was meant to be an addition.
2020-08-28 08:34:36 +02:00
Olivier Goffart
65acdd78b0 Use xtask to generate the headers instead of build.rs of each lib
Fixes #14
2020-08-27 11:50:09 +02:00
Olivier Goffart
58cdaeb8dd Update license header to mention that commertial option are available 2020-08-26 13:23:42 +02:00
Simon Hausmann
9785919f6e Hide a few APIs from the C++ documentation
Since Doxygen can't seem to just exclude them via command, they are moved
into a private_api namespace and then excluded via Doxygen config:

    * *VTable
    * make_dyn_node, ItemTreeNode, etc.
    * VersionCheck
2020-08-25 17:45:12 +02:00
Simon Hausmann
14fe897086 Move all cbindgen generated code into
sixtyfps::cbindgen_private

Having private in the name makes it clear that this is ... private,
and cbindgen helps remember that it's generated.
2020-08-25 15:29:48 +02:00
Olivier Goffart
2c0fc29c5c Some fixup for the documentation 2020-08-25 14:42:18 +02:00
Olivier Goffart
ea1f215367 Some polishinbg of the .toml files
- Give all the sixtyfps-* create a 0.0.1 version
 - Make sure that the internal dependences are using the exact same version
   (so "=0.0.1")
 - Add the description/homepage/repository fields in the .toml files
 - Set publish=false  to crates that are not meant to be published on crates.io
2020-08-24 16:28:11 +02:00
Olivier Goffart
cbeb982684 Use the FieldOffset struct from the upstream create 2020-08-24 11:20:38 +02:00
Simon Hausmann
7f1d9f5252 Commit correct license tags to Cargo.toml
For now that's GPL-3.0 only, but this can be changed :-)
2020-08-18 10:12:59 +02:00
Simon Hausmann
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
d650cadc02 Release graphics resources of items when deleting components in C++ 2020-08-13 13:31:52 +02:00
Simon Hausmann
b96b627a4f Release graphics resources of items when destroying components
This is only implemented for Rust at the moment.
2020-08-13 13:31:29 +02:00
Simon Hausmann
3668234872 Use more fine-grained interior mutability for the rendering
Borrow the rendering and cache individually with different mutability.
We might later, for destruction handling, need to borrow the rendering
cache mutably. That in turn *may* happen even during rendering itself,
as the models are updated lazily during visitor traversal and that may
result in item destruction.
2020-08-13 11:33:34 +02:00
Simon Hausmann
89953e1957 Replace GenericWindow::window_handle() that returns a Ref with a callback
The std::cell::Ref<> exposes the way a refcell is used in a way that
makes it harder to change.
2020-08-13 11:33:34 +02:00
Simon Hausmann
c4d1a8f5fa Remove unnecessary lifetime specifier 2020-08-13 11:33:21 +02:00
Simon Hausmann
f3e6d9b5c5 Fix C++ warning about struct vs. class mismatch 2020-08-12 17:16:27 +02:00
Simon Hausmann
e655909e9f Adding missing missing_docs guards
Those used to be in the abi {} sub-module
2020-08-12 11:45:55 +02:00
Simon Hausmann
d3a474af26 Move corelib::Component and friends back into their dedicated component module 2020-08-12 11:39:07 +02:00
Simon Hausmann
b21aa4f9e7 Rename PropertyListenerScope to PropertyTracker 2020-08-12 11:31:33 +02:00
Simon Hausmann
8a14e15233 Fix signature of Property::set_animated_binding to take an impl Binding 2020-08-12 11:25:19 +02:00
Simon Hausmann
b7d6fed89f Rename Property::get_without_registering_dependency to get_untracked 2020-08-12 11:25:07 +02:00
Simon Hausmann
0df86d7eeb Move corelib::abi::datastructures::Component to corelib 2020-08-12 10:53:03 +02:00
Simon Hausmann
62a8b15f09 Move ItemVTable and frieds to corelib::items
To avoid ambiguities regarding the use of FieldOffset, the BuiltinItem
proc-macro uses fully-qualified type names now.
2020-08-12 10:10:51 +02:00
Simon Hausmann
aafb96cb93 Get rid of abi::datastructures::WindowProperties
Instead, pass a reference to the root item when mapping the window,
at which point we can downcast to the new Window item. If we have one,
then we'll read its width/height (for initial values) and install
bindings to keep them up-to-date.
2020-08-12 09:44:42 +02:00
Simon Hausmann
c1f91e38ca Move the window scale factor into GraphicsWindow 2020-08-11 13:42:51 +02:00
Simon Hausmann
5b90f3edf5 Unmap the window after running the component
This gives a timing wise clearly controlled shutdown of the GL context.
2020-08-11 13:27:31 +02:00
Olivier Goffart
b5c9bf5d10 Settings page for the printer demo
Fix the text maximum size so it can be put in a layout
2020-08-11 12:08:44 +02:00
Olivier Goffart
d43b5fb6f9 Fix offset of the mouse event when the mouse is grabbed 2020-08-11 11:49:02 +02:00
Olivier Goffart
681f304768 Add a few Debug impl 2020-08-10 17:25:15 +02:00
Olivier Goffart
35cb14b2e6 Slider 2020-08-10 14:58:13 +02:00
Olivier Goffart
f4cce26d51 Test the mouse click 2020-08-10 12:54:29 +02:00
Olivier Goffart
36243ccdf7 Traverse item front to back for input events 2020-08-10 10:45:02 +02:00
Simon Hausmann
05d1edbaef Fix caching of fonts by family
Avoid querying coretext/font-config for every lookup
2020-08-07 16:23:24 +02:00
Olivier Goffart
5de801d023 C++: grabbed mouse input 2020-08-07 16:06:49 +02:00
Olivier Goffart
1ee313c643 C++: separate the declaration and the definition of functions
We already did it manually for some functions. But more functions are
about to require the full definition of the other classes
2020-08-07 16:06:49 +02:00
Olivier Goffart
0a56912d0f Mouse grab in rust 2020-08-07 16:06:49 +02:00
Olivier Goffart
5aa7ee86fe Use a newtype for VisitChildrenResult instead of just isize
Makes the code easier to unserstand
2020-08-07 16:06:49 +02:00
Olivier Goffart
55ec533c40 WIP input events
Compile and passes tests. But the mouse event are currently not working
2020-08-07 16:06:49 +02:00
Simon Hausmann
829990f9b1 WIP
Co-authored-by: Olivier Goffart <ogoffart@woboq.com>
2020-08-07 16:06:49 +02:00
Simon Hausmann
f86f8360b2 Fix rendering of text with spaces
Don't waste glyphs and potential pixels from the rasterizer for space --
merely use the advance.
2020-08-07 15:32:59 +02:00
Simon Hausmann
fcc819e395 Add support for enums to the compiler
This replaces the duplicated text alignment enums
2020-08-07 13:15:43 +02:00
Simon Hausmann
aecf6a8878 Center text in buttons in the demo and gallery
This adds horizontal_alignment/vertical_alignment properties, along with
width/height to Text.

This still uses a hard-coded enumeration in the compiler, which is meant
to go away in favor of general enum support.
2020-08-07 10:02:52 +02:00
Simon Hausmann
7ad693da60 Make window state handling more robust
Replace the three (ref)cells in the window with one refcell to an enum that
determines that the window is either unmapped (with a factory available)
or mapped (we have a graphics backend and rendering cache).
2020-08-06 16:57:19 +02:00