[librsvg] drawing_ctx.rs: Bind get_pango_context() to Rust
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] drawing_ctx.rs: Bind get_pango_context() to Rust
- Date: Fri, 15 Dec 2017 18:53:17 +0000 (UTC)
commit bed85586a257c8fe25a0f3a61e38bb8fe958ddab
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Dec 14 14:05:04 2017 -0600
drawing_ctx.rs: Bind get_pango_context() to Rust
rust/src/drawing_ctx.rs | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/rust/src/drawing_ctx.rs b/rust/src/drawing_ctx.rs
index e5b0b40..77e0257 100644
--- a/rust/src/drawing_ctx.rs
+++ b/rust/src/drawing_ctx.rs
@@ -1,8 +1,10 @@
-use ::cairo;
-use ::cairo_sys;
-use ::glib_sys;
-use ::glib::translate::*;
-use ::libc;
+use cairo;
+use cairo_sys;
+use glib_sys;
+use glib::translate::*;
+use libc;
+use pango_sys;
+use pango;
use color::*;
use error::*;
@@ -46,6 +48,8 @@ extern "C" {
fn rsvg_drawing_ctx_set_current_state_affine (draw_ctx: *const RsvgDrawingCtx,
affine: *const cairo::Matrix);
+ fn rsvg_drawing_ctx_get_pango_context(draw_ctx: *const RsvgDrawingCtx) -> *mut pango_sys::PangoContext;
+
fn rsvg_drawing_ctx_add_clipping_rect (draw_ctx: *const RsvgDrawingCtx,
x: f64,
y: f64,
@@ -200,6 +204,12 @@ pub fn set_current_state_affine (draw_ctx: *const RsvgDrawingCtx, affine: cairo:
}
}
+pub fn get_pango_context(draw_ctx: *const RsvgDrawingCtx) -> pango::Context {
+ unsafe {
+ from_glib_full(rsvg_drawing_ctx_get_pango_context(draw_ctx))
+ }
+}
+
pub fn add_clipping_rect (draw_ctx: *const RsvgDrawingCtx,
x: f64,
y: f64,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]