• Benjamin Otte's avatar
    snapshot: Work on pushing and popping again · 1137483d
    Benjamin Otte authored
    It is now possible to call push() subfunctions for simple container
    nodes with just a single child. So you can for example
    gtk_snapshot_push_clip() a clip region that all the nodes that get
    appended later will then obey.
    
    gtk_snapshot_pop() will then not return a container node, but a clip
    node containing the container node (and similar for the transform
    example).
    
    This is implemented internally by providing a "collect function" when
    pushing that is called when popping to collects all the accumulated
    nodes and combine them into the single node that gets returned.
    
    To simplify things even more, gtk_snapshot_pop_and_append() has been
    added, which pops the currently pushed node and appends it to the
    parent.
    
    The icon rendering code has been converted to this approach.
    1137483d
gtksnapshotprivate.h 2.21 KB