[librsvg] Provide and bind rsvg_state_set_cond_true() to Rust



commit dc4f567e80b69769ce475095613fe42898fbcd92
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Dec 5 19:24:31 2017 -0600

    Provide and bind rsvg_state_set_cond_true() to Rust

 rsvg-styles.c           |    6 ++++++
 rsvg-styles.h           |    3 +++
 rust/src/drawing_ctx.rs |    5 +++++
 3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/rsvg-styles.c b/rsvg-styles.c
index 1629465..63f743a 100644
--- a/rsvg-styles.c
+++ b/rsvg-styles.c
@@ -1737,6 +1737,12 @@ rsvg_state_get_cond_true (RsvgState *state)
     return state->cond_true;
 }
 
+void
+rsvg_state_set_cond_true (RsvgState *state, gboolean cond_true)
+{
+    state->cond_true = cond_true;
+}
+
 RsvgCssColorSpec *
 rsvg_state_get_stop_color (RsvgState *state)
 {
diff --git a/rsvg-styles.h b/rsvg-styles.h
index 45ff753..d170b4d 100644
--- a/rsvg-styles.h
+++ b/rsvg-styles.h
@@ -242,6 +242,9 @@ G_GNUC_INTERNAL
 gboolean rsvg_state_get_cond_true (RsvgState *state);
 
 G_GNUC_INTERNAL
+void rsvg_state_set_cond_true (RsvgState *state, gboolean cond_true);
+
+G_GNUC_INTERNAL
 RsvgCssColorSpec *rsvg_state_get_stop_color (RsvgState *state);
 
 G_GNUC_INTERNAL
diff --git a/rust/src/drawing_ctx.rs b/rust/src/drawing_ctx.rs
index ee25c62..e5b0b40 100644
--- a/rust/src/drawing_ctx.rs
+++ b/rust/src/drawing_ctx.rs
@@ -64,6 +64,7 @@ extern "C" {
     fn rsvg_state_is_overflow (state: *const RsvgState) -> glib_sys::gboolean;
     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_set_cond_true (state: *const RsvgState, cond_true: glib_sys::gboolean);
     fn rsvg_state_get_stop_color (state: *const RsvgState) -> *const ColorSpec;
     fn rsvg_state_get_stop_opacity (state: *const RsvgState) -> *const OpacitySpec;
     fn rsvg_state_get_current_color (state: *const RsvgState) -> u32;
@@ -245,6 +246,10 @@ pub fn state_get_cond_true (state: *const RsvgState) -> bool {
     unsafe { from_glib (rsvg_state_get_cond_true (state)) }
 }
 
+pub fn state_set_cond_true (state: *const RsvgState, cond_true: bool) {
+    unsafe { rsvg_state_set_cond_true (state, cond_true.to_glib()); }
+}
+
 pub fn state_push (draw_ctx: *const RsvgDrawingCtx) {
     unsafe {
         rsvg_state_push (draw_ctx);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]