I hereby claim:
- I am federicomenaquintero on github.
- I am federico (https://keybase.io/federico) on keybase.
- I have a public key whose fingerprint is 263F 590F 7E0F E1CB 3EA2 74B0 1676 37EB 6FB8 DCCE
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| pub struct Node<'a> { | |
| node_type: NodeType, | |
| parent: RefCell<Option<Weak<Node<'a>>>>, // cell for interior mutability; optional; weak ref to parent | |
| children: Vec<Rc<Node<'a>>>, // strong references to children | |
| state: *mut RsvgState, | |
| node_impl: &'a NodeTrait | |
| } | |
| impl<'a> Node<'a> { | |
| // ... |
| // Trait for node implementations (bezier paths, circles, etc.) | |
| pub trait NodeTrait { | |
| fn set_atts (&self, ...); | |
| fn draw (&self, ...); | |
| } | |
| // Node in the tree of SVG elements | |
| pub struct Node { | |
| node_type: NodeType, | |
| parent: Option<Weak<Node>>, |
| pub struct Node { | |
| ... | |
| } | |
| pub type RsvgNode = Weak<Node>; | |
| /* This one works */ | |
| #[no_mangle] | |
| pub unsafe extern fn rsvg_node_ref (raw_node: *mut RsvgNode) -> *const RsvgNode { | |
| assert! (!raw_node.is_null ()); |
| use nom::{double}; | |
| named! (pub comma, | |
| tag! (b",")); | |
| // Parse a viewBox attribute | |
| // https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute | |
| // | |
| // viewBox: double [,] double [,] double [,] double [,] | |
| // |
| enum MarkerType { | |
| Start, | |
| Middle, | |
| End | |
| } | |
| type RenderMarkerFn = fn (MarkerType, | |
| f64, // xpos | |
| f64, // ypos | |
| f64); // computed_angle |
| fn emit_marker_at_start_of_segment<E> (some args..., | |
| emit_fn: E) where E: Fn(MarkerType, f64, f64, f64) { ... } | |
| fn emit_markers_for_path_builder<E> (builder: &RsvgPathBuilder, | |
| emit_fn: E) where E: Fn(MarkerType, f64, f64, f64) { | |
| for ... { | |
| ... multiple calls to functions which take in emit_fn ... | |
| emit_marker_at_start_of_segment (..., emit_fn); |
| /********************************************************************************/ | |
| pub mod DummyMod { | |
| extern crate glib_sys as glib_ffi ; | |
| extern crate gobject_sys as gobject_ffi ; | |
| extern crate glib ; | |
| extern crate libc ; | |
| use glib::{IsA, Value}; | |
| use glib::object::Downcast; | |
| use glib::signal::connect; | |
| use glib::translate::*; |
| gobject_gen! { | |
| class Dummy { | |
| struct DummyPrivate { | |
| dc: RefCell<DropCounter> | |
| } | |
| private_init() -> DummyPrivate { | |
| DummyPrivate { | |
| dc: RefCell::new(DropCounter::new()) | |
| } |
| gobject_gen! { | |
| class Dummy { | |
| struct DummyPrivate { | |
| foo: RefCell<MyStruct> | |
| } | |
| private_init() -> DummyPrivate { | |
| DummyPrivate { | |
| foo: RefCell::new(MyStruct::new()) | |
| } |