Port RsvgState struct to Rust
rsvg-styles.c
has RsvgState
, our CSS state struct. It has a lot of bool has_foo
and SomeType foo
fields to indicate whether a particular property was specified in the SVG or CSS data; those map well to Option<T>
.
I am not sure whether we can make the following assertions, but I think we can, and I'd like to ensure that they are true:
-
After each
Node
is created and itsset_atts()
method is called, the node'sRsvgState
should be immutable. -
The only mutable
RsvgState
is the stack-of-states maintained inRsvgDrawingCtx
, and any temporary states created here and there.
Also, there are functions which look like methods but aren't, like void rsvg_state_pop (RsvgDrawingCtx * ctx);
. Maybe rename it to rsvg_drawing_ctx_state_pop()
first.