rsvg_state_get_current_color(): Expose to Rust

parent 5c0a332f
......@@ -1689,22 +1689,26 @@ rsvg_state_reconstruct (RsvgState *state, RsvgNode *current)
rsvg_state_inherit (state, rsvg_node_get_state (current));
}
gboolean rsvg_state_is_overflow (RsvgState *state)
gboolean
rsvg_state_is_overflow (RsvgState *state)
{
return state->overflow;
}
gboolean rsvg_state_has_overflow (RsvgState *state)
gboolean
rsvg_state_has_overflow (RsvgState *state)
{
return state->has_overflow;
}
gboolean rsvg_state_get_cond_true (RsvgState *state)
gboolean
rsvg_state_get_cond_true (RsvgState *state)
{
return state->cond_true;
}
RsvgCssColorSpec *rsvg_state_get_stop_color (RsvgState *state)
RsvgCssColorSpec *
rsvg_state_get_stop_color (RsvgState *state)
{
if (state->has_stop_color) {
return &state->stop_color;
......@@ -1712,3 +1716,9 @@ RsvgCssColorSpec *rsvg_state_get_stop_color (RsvgState *state)
return NULL;
}
}
guint32
rsvg_state_get_current_color (RsvgState *state)
{
return state->current_color;
}
......@@ -253,6 +253,9 @@ gboolean rsvg_state_get_cond_true (RsvgState *state);
G_GNUC_INTERNAL
RsvgCssColorSpec *rsvg_state_get_stop_color (RsvgState *state);
G_GNUC_INTERNAL
guint32 rsvg_state_get_current_color (RsvgState *state);
G_END_DECLS
#endif /* RSVG_STYLES_H */
......@@ -64,6 +64,7 @@ extern "C" {
fn rsvg_state_has_overflow (state: *const RsvgState) -> glib_sys::gboolean;
fn rsvg_state_get_cond_true (state: *const RsvgState) -> glib_sys::gboolean;
fn rsvg_state_get_stop_color (state: *const RsvgState) -> *const ColorSpec;
fn rsvg_state_get_current_color (state: *const RsvgState) -> u32;
fn rsvg_state_push (draw_ctx: *const RsvgDrawingCtx);
fn rsvg_state_pop (draw_ctx: *const RsvgDrawingCtx);
......@@ -246,3 +247,9 @@ pub fn state_get_stop_color (state: *const RsvgState) -> Option<ColorSpec> {
}
}
}
pub fn state_get_current_color (state: *const RsvgState) -> u32 {
unsafe {
rsvg_state_get_current_color (state)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment