rendernodeparser: Add support for reusing nodes
authorBenjamin Otte <otte@redhat.com>
Tue, 28 Mar 2023 21:58:50 +0000 (23:58 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 29 Mar 2023 01:53:52 +0000 (03:53 +0200)
commit5a0c4de07f75d89e5b84f9dcade7b17c019433d8
treeabca6784d55f7950ba8ffb075ab6a9b97c70585f
parent348a68599a94ab1a04f9234e7e3758665ad8b990
rendernodeparser: Add support for reusing nodes

We extend the syntax for nodes from:
  <node-type> { ... }
to
  <node-type> { ... }
  <node-type> <string> { ... }
  <string>;
where the first is the same as before, the 2nd defines a named node and
the last references a previously defined node.
Or to give an example:
  color "node" {
    bounds: 0 0 10 10;
    color: red;
  }
  transform {
    bounds: 20 0 10 10;
    child: "node";
  }
This will draw the red box twice, once at (0,0) and once at
(20,0).

The intended use for this is both shortening generated node files as
well as allowing to write tests that reuse nodes, in particular when
dealing with caches.
gsk/gskrendernodeparser.c