diff options
-rw-r--r-- | librsvg/rsvg-styles.c | 12 | ||||
-rw-r--r-- | librsvg/rsvg-styles.h | 6 | ||||
-rw-r--r-- | rsvg_internals/src/state.rs | 18 |
3 files changed, 36 insertions, 0 deletions
diff --git a/librsvg/rsvg-styles.c b/librsvg/rsvg-styles.c index f31dfadf..419d8ae9 100644 --- a/librsvg/rsvg-styles.c +++ b/librsvg/rsvg-styles.c @@ -1967,6 +1967,18 @@ rsvg_state_get_clip_rule (RsvgState *state) return state->clip_rule; } +RsvgPaintServer * +rsvg_state_get_fill (RsvgState *state) +{ + return state->fill; +} + +guint8 +rsvg_state_get_fill_opacity (RsvgState *state) +{ + return state->fill_opacity; +} + cairo_fill_rule_t rsvg_state_get_fill_rule (RsvgState *state) { diff --git a/librsvg/rsvg-styles.h b/librsvg/rsvg-styles.h index 070d1ec5..b7031b31 100644 --- a/librsvg/rsvg-styles.h +++ b/librsvg/rsvg-styles.h @@ -308,6 +308,12 @@ G_GNUC_INTERNAL cairo_fill_rule_t rsvg_state_get_clip_rule (RsvgState *state); G_GNUC_INTERNAL +RsvgPaintServer *rsvg_state_get_fill (RsvgState *state); + +G_GNUC_INTERNAL +guint8 rsvg_state_get_fill_opacity (RsvgState *state); + +G_GNUC_INTERNAL cairo_fill_rule_t rsvg_state_get_fill_rule (RsvgState *state); G_GNUC_INTERNAL diff --git a/rsvg_internals/src/state.rs b/rsvg_internals/src/state.rs index 648ce08b..7ac2578f 100644 --- a/rsvg_internals/src/state.rs +++ b/rsvg_internals/src/state.rs @@ -82,6 +82,8 @@ extern "C" { fn rsvg_state_get_letter_spacing(state: *const RsvgState) -> RsvgLength; fn rsvg_state_get_font_decor(state: *const RsvgState) -> *const TextDecoration; fn rsvg_state_get_clip_rule(state: *const RsvgState) -> cairo::FillRule; + fn rsvg_state_get_fill(state: *const RsvgState) -> *const PaintServer; + fn rsvg_state_get_fill_opacity(state: *const RsvgState) -> u8; fn rsvg_state_get_fill_rule(state: *const RsvgState) -> cairo::FillRule; } @@ -264,6 +266,22 @@ pub fn get_clip_rule(state: *const RsvgState) -> cairo::FillRule { unsafe { rsvg_state_get_clip_rule(state) } } +pub fn get_fill<'a>(state: *const RsvgState) -> Option<&'a PaintServer> { + unsafe { + let ps = rsvg_state_get_fill(state); + + if ps.is_null() { + None + } else { + Some(&*ps) + } + } +} + +pub fn get_fill_opacity(state: *const RsvgState) -> u8 { + unsafe { rsvg_state_get_fill_opacity(state) } +} + pub fn get_fill_rule(state: *const RsvgState) -> cairo::FillRule { unsafe { rsvg_state_get_fill_rule(state) } } |