Commit graph

63 commits

Author SHA1 Message Date
Olivier Goffart
315fd7a881 Start doing a ScrollArea element
Unfortunately something is wrong with the Qt style, it looks like the Qt style
does not respect the rect given for the sub components

Also Input is not handled yet.
2020-09-22 20:05:41 +02:00
Simon Hausmann
625cb6c6b8 Add a constructor to Text and let the color default to black
We really shouldn't require specifying a color for every Text {} element just in order
to see *some* text.

For Rectangle OTOH transparent is a good default (and thus for Color), hence
this change just to Text.

Right now the constructor bit is also a bit repetitive, this could
perhaps be folded into BuiltinItem to generate the ffi, default impl and
forward to an init function if it exists.
2020-09-16 08:20:13 +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
2823f32692 Apply license headers to all non-binary/non-json sources 2020-08-17 17:55:20 +02:00
Simon Hausmann
3d5d112deb Fix paths to logos 2020-08-11 16:57:04 +02:00
Simon Hausmann
f2eec61968 Add a window to the top-level component
This means that we always have a window and for the C++
API we don't require this ComponentWindow use anymore.
2020-08-11 13:38:38 +02:00
Olivier Goffart
b259a09338 Rename the types float32 and int32 to float and int 2020-08-03 16:15:41 +02:00
Olivier Goffart
b2a1a72450 C++: add on_* funciton to connect to signals 2020-08-03 15:01:10 +02:00
Olivier Goffart
9760cf4969 Begin to implement a Flickable
The implementation is still very rough and will need to be improved
2020-07-30 14:36:21 +02:00
Olivier Goffart
6c54dfb67d Layout the item in a PathLayout if they are part of a repeater 2020-07-17 15:00:12 +02:00
Olivier Goffart
dfd4a35e35 Set the DPI property according to the window's screen 2020-07-15 18:46:55 +02:00
Olivier Goffart
1dec276002 Continue adapting the window size
Implement the Rust and C++ part
2020-07-15 17:52:14 +02:00
Olivier Goffart
8e7e3aaa7a Make the length its own unit 2020-07-14 17:45:03 +02:00
Olivier Goffart
4b20bf97ef Add px unit in many places
(This was done automatically with the updater)
2020-07-14 17:14:59 +02:00
Olivier Goffart
952ddda7c4 Force duration to have an unit 2020-07-14 16:18:12 +02:00
Olivier Goffart
e00491811b Get rid of the context in properties/signal 2020-07-13 18:49:06 +02:00
Simon Hausmann
251ef7fc97 Add support for SVG commands in Path elements
Using the commands property we can just paste SVG paths. This makes it
much easier to write examples/demos. A good online path designer is
for example https://codepen.io/anthonydugois/pen/mewdyZ
2020-07-09 13:41:57 +02:00
Olivier Goffart
d0b44a125d Support for if expression in the interpreter
Dynamic model or expression not yet supported
2020-07-03 17:56:48 +02:00
Simon Hausmann
b8ca0fe3c9 Add support for animating color properties 2020-06-27 16:51:48 +02:00
Olivier Goffart
c682d14e0b C++: Object literal and ObjectAccess 2020-06-22 18:30:40 +02:00
Olivier Goffart
fa0c393dca Interpreter: Fix property access from parent component in repeater element 2020-06-22 15:22:38 +02:00
Olivier Goffart
1bb8d94ab8 Support array for model in rust and in the interpreter 2020-06-19 19:46:59 +02:00
Simon Hausmann
8f613685ba Expose a ComponentWindow in C++
This paves a way for a more modular API.
2020-06-17 19:15:18 +02:00
Olivier Goffart
096fd7bbb4 Repeater in C++ 2020-06-17 14:39:33 +02:00
Olivier Goffart
8713c10d48 Color literals 2020-06-11 19:26:41 +02:00
Olivier Goffart
907bea3d3b Layout for rust 2020-06-10 19:41:24 +02:00
Simon Hausmann
63f81e1991 Add basic support for conditional expressions
Todo are automated tests and cleaning up the C++ implementation.
2020-06-10 16:04:15 +02:00
Simon Hausmann
4eb50335a4 Prospective build fix for the CI
Make sure to prepare the cmake module and extend the lookup in the
project to prefer the local build.
2020-06-04 16:55:27 +02:00
Simon Hausmann
2e0a5ddb25 Create & install a cmake package file (part 3)
The cargo target directory tree is now populated with a cmake package
file and that's also installed into the prefix specified with the cargo
cmake xtask.

As a consequence, the cpptest example can be built by first building the
cmake package:

    cargo xtask cmake

    or

    cargo xtask cmake --release --target some-triplet)

    or

    cargo xtask cmake --release --prefix /somewhere --install

and then run cmake in the cpptest example with a prefix path:

    -DCMAKE_PREFIX_PATH=/where/you/installed/it or simply
    -DCMAKE_PREFIX_PATH=../../target/debug for example.

Pending still is the sixtyfps compiler tool installation and discovery.
2020-06-04 15:33:18 +02:00
Simon Hausmann
c5001703d4 Build the cmake module for our runtime as xtask, part 2
This is done by calling cargo with json output to build the libraries,
collect the .a files, extract the native libraries needed for final
linkage and pass all that to a CMake project that cobbles together the
.a files into a propery cmake target with include paths, etc.
2020-06-04 15:29:19 +02:00
Simon Hausmann
33cfe03dc9 Rework the C++ facing build system, part 1
The objective is to automatically create a propery cmake module, with a
FindSixtyFPSConfig.cmake, corresponding targets .cmake files, etc. This
should encapsulate the build profile (debug vs. release) and also allow
making the choice of shared vs. static transparent.

Unfortunately it does not seem to be possible to easily combine different
crates into one cdylib crate that can re-export symbols from the
statically linked rust crates (cbindgen generated, as well as manual
extern "C").

That means for the dynamic case (not cared for right now), we're going
to need to create either one cdylib per crate that has public symbols or
manually re-export the symbols.

For the static case, linking just against the "last crate" in the chain
(the gl renderer backend) is sufficient to pull in all needed symbols.

In addition for the static case we need to specify the linkage of some
external libraries. This can be extracted manually via

    cargo rustc -p gl -- --print=native-static-libs

for example. For now that's in the changed CMakeLists.txt, but the plan
going forward is to automate this extraction in an xtask, to paste that
into the cmake target.

Finally, both linkage scenarios require access to the headers. This is
for now solved by generating them simply in an include sub-directory of
the build folder ($root/target/${profile}/include).
2020-06-04 15:29:19 +02:00
Olivier Goffart
13c7e0dec8 Begin working on a Node API
Currently, the followinf command in the example/nodetest directory works:
    npm install ../../api/sixtyfps-node && node main.js
2020-06-03 17:33:05 +02:00
Olivier Goffart
619e21295d reformat 2020-05-28 17:15:11 +02:00
Olivier Goffart
dc276290e9 Add support for self assignment (+=, -=, ...) 2020-05-28 17:02:06 +02:00
Olivier Goffart
74898a1386 Make property conneciton binding in the C++
(somehow plus/minus is not working yet)
2020-05-28 14:52:43 +02:00
Olivier Goffart
95b671c97c Support for code blocks and signal call 2020-05-28 12:30:08 +02:00
Simon Hausmann
f2df9293a9 Fix the C++ build
Remove the Optional from the evaluation context passing for property
evaluation. Unfortunately there are nullptr uses left on the C++ side,
that need to be replaced with passing through.
2020-05-28 12:07:11 +02:00
Olivier Goffart
5580b5112f Fix number to string conversion in C++ 2020-05-27 16:18:08 +02:00
Olivier Goffart
41332a759f Make property reference works in C++ 2020-05-27 10:00:45 +02:00
Olivier Goffart
36fb526811 Do inlining in a pass before the lowering 2020-05-26 15:10:27 +02:00
Simon Hausmann
0932953ac8 Implement property declarations for the C++ backend 2020-05-25 19:13:52 +02:00
Olivier Goffart
d8601621c0 Use the tool to replace = with := 2020-05-25 10:44:22 +02:00
Olivier Goffart
c03c2e2e7e Attempt to do Plus / Minus 2020-05-21 13:24:45 +02:00
Olivier Goffart
54eb0f831b Fix the children allocation array
The offsets was not computed properly
2020-05-21 13:14:28 +02:00
Olivier Goffart
4575011293 More work on signal: the C++ part is working 2020-05-20 19:28:58 +02:00
Olivier Goffart
efe0ccfb3f Add support for signal in the parser
(currently not doing anything else than parsing)
2020-05-20 12:53:08 +02:00
Olivier Goffart
6b3765857a Add a TouchArea builtin item (currently does nothing) 2020-05-20 09:32:01 +02:00
Olivier Goffart
260f17a3e0 Support for inline components within a .60 file 2020-05-19 17:43:56 +02:00
Olivier Goffart
a4569ddca3 BangExpression allow for finding relative paths 2020-05-19 15:36:56 +02:00
Olivier Goffart
25bf149e13 Add a shared string that can be used in properties 2020-05-18 17:09:40 +02:00