[librsvg/rustification] drawing_ctx.rs: Wrappers for acquire_node() and release_node()



commit 9355820e6a3f796860e3bde7520295ce23664ea5
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 30 19:18:43 2016 -0600

    drawing_ctx.rs: Wrappers for acquire_node() and release_node()

 rust/src/drawing_ctx.rs |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/rust/src/drawing_ctx.rs b/rust/src/drawing_ctx.rs
index 0eba6fc..e579a58 100644
--- a/rust/src/drawing_ctx.rs
+++ b/rust/src/drawing_ctx.rs
@@ -10,6 +10,8 @@ use path_builder::RsvgPathBuilder;
 
 pub enum RsvgDrawingCtx {}
 
+pub enum RsvgNode {}
+
 extern "C" {
     fn rsvg_drawing_ctx_get_dpi (draw_ctx: *const RsvgDrawingCtx,
                                  out_dpi_x: *mut f64,
@@ -27,6 +29,12 @@ extern "C" {
 
     fn rsvg_drawing_ctx_pop_view_box (draw_ctx: *const RsvgDrawingCtx);
 
+    fn rsvg_drawing_ctx_acquire_node (draw_ctx: *const RsvgDrawingCtx,
+                                      url:      *const libc::c_char) -> *mut RsvgNode;
+
+    fn rsvg_drawing_ctx_release_node (draw_ctx: *const RsvgDrawingCtx,
+                                      node:     *mut RsvgNode);
+
     fn rsvg_state_reinherit_top (draw_ctx: *const RsvgDrawingCtx,
                                  state: *mut RsvgState,
                                  dominate: libc::c_int);
@@ -71,6 +79,16 @@ pub fn pop_view_box (draw_ctx: *const RsvgDrawingCtx) {
     unsafe { rsvg_drawing_ctx_pop_view_box (draw_ctx); }
 }
 
+pub fn acquire_node (draw_ctx: *const RsvgDrawingCtx,
+                     url:      &str) -> *mut RsvgNode {
+    unsafe { rsvg_drawing_ctx_acquire_node (draw_ctx, str::to_glib_none (url).0) }
+}
+
+pub fn release_node (draw_ctx: *const RsvgDrawingCtx,
+                     node:     *mut RsvgNode) {
+    unsafe { rsvg_drawing_ctx_release_node (draw_ctx, node); }
+}
+
 pub fn state_reinherit_top (draw_ctx: *const RsvgDrawingCtx,
                             state: *mut RsvgState,
                             dominate: i32) {


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