Remove a bunch of unused rsvg_path_builder_*() functions

All the callers are now in shapes.rs, so the functions exported from
RsvgPathBuilder to C can be removed now.

Also, remove rsvg_path_parser_from_str_into_builder() from the Rust
code; it's also unused.
parent aeed2129
......@@ -39,46 +39,9 @@ G_BEGIN_DECLS
typedef struct _RsvgPathBuilder RsvgPathBuilder;
G_GNUC_INTERNAL
RsvgPathBuilder *rsvg_path_builder_new (void);
G_GNUC_INTERNAL
void rsvg_path_builder_destroy (RsvgPathBuilder *builder);
G_GNUC_INTERNAL
void rsvg_path_builder_move_to (RsvgPathBuilder *builder,
double x,
double y);
G_GNUC_INTERNAL
void rsvg_path_builder_line_to (RsvgPathBuilder *builder,
double x,
double y);
G_GNUC_INTERNAL
void rsvg_path_builder_curve_to (RsvgPathBuilder *builder,
double x1,
double y1,
double x2,
double y2,
double x3,
double y3);
G_GNUC_INTERNAL
void rsvg_path_builder_arc (RsvgPathBuilder *builder,
double x1, double y1,
double rx, double ry,
double x_axis_rotation,
gboolean large_arc_flag, gboolean sweep_flag,
double x2, double y2);
G_GNUC_INTERNAL
void rsvg_path_builder_close_path (RsvgPathBuilder *builder);
G_GNUC_INTERNAL
void rsvg_path_builder_add_to_cairo_context (RsvgPathBuilder *builder, cairo_t *cr);
G_GNUC_INTERNAL
RsvgPathBuilder *rsvg_path_parser_from_str_into_builder (const char *path_str);
G_END_DECLS
#endif /* RSVG_PATH_BUILDER_H */
......@@ -61,20 +61,9 @@ pub use node::{
};
pub use path_builder::{
rsvg_path_builder_new,
rsvg_path_builder_destroy,
rsvg_path_builder_move_to,
rsvg_path_builder_line_to,
rsvg_path_builder_curve_to,
rsvg_path_builder_close_path,
rsvg_path_builder_arc,
rsvg_path_builder_add_to_cairo_context
};
pub use path_parser::{
rsvg_path_parser_from_str_into_builder
};
pub use pattern::{
pattern_new,
pattern_destroy,
......
......@@ -225,86 +225,6 @@ fn clamp (val: f64, low: f64, high: f64) -> f64 {
}
}
#[no_mangle]
pub unsafe extern fn rsvg_path_builder_new () -> *mut RsvgPathBuilder {
let builder = RsvgPathBuilder::new ();
let boxed_builder = Box::new (builder);
Box::into_raw (boxed_builder)
}
#[no_mangle]
pub unsafe extern fn rsvg_path_builder_destroy (raw_builder: *mut RsvgPathBuilder) {
assert! (!raw_builder.is_null ());
let _ = Box::from_raw (raw_builder);
}
#[no_mangle]
pub extern fn rsvg_path_builder_move_to (raw_builder: *mut RsvgPathBuilder,
x: f64,
y: f64) {
assert! (!raw_builder.is_null ());
let builder: &mut RsvgPathBuilder = unsafe { &mut (*raw_builder) };
builder.move_to (x, y);
}
#[no_mangle]
pub extern fn rsvg_path_builder_line_to (raw_builder: *mut RsvgPathBuilder,
x: f64,
y: f64) {
assert! (!raw_builder.is_null ());
let builder: &mut RsvgPathBuilder = unsafe { &mut (*raw_builder) };
builder.line_to (x, y);
}
#[no_mangle]
pub extern fn rsvg_path_builder_curve_to (raw_builder: *mut RsvgPathBuilder,
x2: f64, y2: f64,
x3: f64, y3: f64,
x4: f64, y4: f64) {
assert! (!raw_builder.is_null ());
let builder: &mut RsvgPathBuilder = unsafe { &mut (*raw_builder) };
builder.curve_to (x2, y2, x3, y3, x4, y4);
}
#[no_mangle]
pub extern fn rsvg_path_builder_arc (raw_builder: *mut RsvgPathBuilder,
x1: f64, y1: f64,
rx: f64, ry: f64,
x_axis_rotation: f64,
large_arc_flag: bool,
sweep_flag: bool,
x2: f64, y2: f64) {
assert! (!raw_builder.is_null ());
let builder: &mut RsvgPathBuilder = unsafe { &mut (*raw_builder) };
builder.arc (x1, y1,
rx, ry,
x_axis_rotation,
large_arc_flag,
sweep_flag,
x2, y2);
}
#[no_mangle]
pub extern fn rsvg_path_builder_close_path (raw_builder: *mut RsvgPathBuilder) {
assert! (!raw_builder.is_null ());
let builder: &mut RsvgPathBuilder = unsafe { &mut (*raw_builder) };
builder.close_path ();
}
#[no_mangle]
pub extern fn rsvg_path_builder_add_to_cairo_context (raw_builder: *mut RsvgPathBuilder, cr: *mut cairo_sys::cairo_t) {
assert! (!raw_builder.is_null ());
......
......@@ -999,22 +999,6 @@ pub fn parse_path_into_builder (path_str: &str, builder: &mut RsvgPathBuilder) -
}
}
#[no_mangle]
pub extern fn rsvg_path_parser_from_str_into_builder (path_str: *const libc::c_char) -> *mut RsvgPathBuilder {
let mut builder = RsvgPathBuilder::new ();
let my_path_str = unsafe { &String::from_glib_none (path_str) };
{
let mut parser = PathParser::new (&mut builder, my_path_str);
parser.parse ();
/* FIXME: we aren't passing errors back to the caller. */
}
let boxed_builder = Box::new (builder);
Box::into_raw (boxed_builder)
}
#[cfg(test)]
mod tests {
use super::*;
......
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