[librsvg: 1/3] Use exported Rust functions directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/3] Use exported Rust functions directly
- Date: Thu, 24 Sep 2020 23:44:21 +0000 (UTC)
commit 6704fdc8f64bad72e1150bb5287c787f397366ef
Author: Sven Neumann <sven svenfoo org>
Date: Thu Sep 24 12:11:48 2020 +0200
Use exported Rust functions directly
Remove the C wrapper functions that used to call the functions exported
from Rust code and rename the exported functions so that they directly
provide the C API.
librsvg/c_api.rs | 102 +++++++------
librsvg/dpi.rs | 13 +-
librsvg/lib.rs | 67 ++++-----
librsvg/pixbuf_utils.rs | 33 ++++-
librsvg/rsvg-base.c | 55 -------
librsvg/rsvg-css.h | 2 +-
librsvg/rsvg-handle.c | 372 ------------------------------------------------
librsvg/rsvg-pixbuf.c | 67 ---------
rsvg-convert.c | 2 +-
9 files changed, 126 insertions(+), 587 deletions(-)
---
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index b58d5780..7c1be8a4 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -76,7 +76,7 @@ mod handle_flags {
impl StaticType for HandleFlags {
fn static_type() -> Type {
- unsafe { from_glib(rsvg_rust_handle_flags_get_type()) }
+ unsafe { from_glib(rsvg_handle_flags_get_type()) }
}
}
@@ -1023,12 +1023,12 @@ fn get_rust_handle<'a>(handle: *const RsvgHandle) -> &'a CHandle {
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_type() -> glib_sys::GType {
+pub unsafe extern "C" fn rsvg_handle_get_type() -> glib_sys::GType {
CHandle::get_type().to_glib()
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_error_get_type() -> glib_sys::GType {
+pub unsafe extern "C" fn rsvg_error_get_type() -> glib_sys::GType {
static ONCE: Once = Once::new();
static mut ETYPE: glib_sys::GType = gobject_sys::G_TYPE_INVALID;
@@ -1064,7 +1064,7 @@ pub unsafe extern "C" fn rsvg_rust_error_get_type() -> glib_sys::GType {
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_flags_get_type() -> glib_sys::GType {
+pub unsafe extern "C" fn rsvg_handle_flags_get_type() -> glib_sys::GType {
static ONCE: Once = Once::new();
static mut FTYPE: glib_sys::GType = gobject_sys::G_TYPE_INVALID;
@@ -1110,7 +1110,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_flags_get_type() -> glib_sys::GType {
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_base_url(
+pub unsafe extern "C" fn rsvg_handle_set_base_uri(
handle: *const RsvgHandle,
uri: *const libc::c_char,
) {
@@ -1130,7 +1130,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_base_url(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_base_gfile(
+pub unsafe extern "C" fn rsvg_handle_set_base_gfile(
handle: *const RsvgHandle,
raw_gfile: *mut gio_sys::GFile,
) {
@@ -1151,7 +1151,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_base_gfile(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_base_url(
+pub unsafe extern "C" fn rsvg_handle_get_base_uri(
handle: *const RsvgHandle,
) -> *const libc::c_char {
rsvg_return_val_if_fail! {
@@ -1166,7 +1166,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_base_url(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_dpi(handle: *const RsvgHandle, dpi: f64) {
+pub unsafe extern "C" fn rsvg_handle_set_dpi(handle: *const RsvgHandle, dpi: f64) {
rsvg_return_if_fail! {
rsvg_handle_set_dpi;
@@ -1179,7 +1179,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_dpi(handle: *const RsvgHandle, dpi
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_dpi_x_y(
+pub unsafe extern "C" fn rsvg_handle_set_dpi_x_y(
handle: *const RsvgHandle,
dpi_x: f64,
dpi_y: f64,
@@ -1196,7 +1196,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_dpi_x_y(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_size_callback(
+pub unsafe extern "C" fn rsvg_handle_set_size_callback(
handle: *const RsvgHandle,
size_func: RsvgSizeFunc,
user_data: glib_sys::gpointer,
@@ -1214,7 +1214,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_size_callback(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_testing(
+pub unsafe extern "C" fn rsvg_handle_internal_set_testing(
handle: *const RsvgHandle,
testing: glib_sys::gboolean,
) {
@@ -1230,7 +1230,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_testing(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_read_stream_sync(
+pub unsafe extern "C" fn rsvg_handle_read_stream_sync(
handle: *const RsvgHandle,
stream: *mut gio_sys::GInputStream,
cancellable: *mut gio_sys::GCancellable,
@@ -1261,7 +1261,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_read_stream_sync(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_write(
+pub unsafe extern "C" fn rsvg_handle_write(
handle: *const RsvgHandle,
buf: *const u8,
count: usize,
@@ -1283,7 +1283,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_write(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_close(
+pub unsafe extern "C" fn rsvg_handle_close(
handle: *const RsvgHandle,
error: *mut *mut glib_sys::GError,
) -> glib_sys::gboolean {
@@ -1306,7 +1306,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_close(
}
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_has_sub(
+pub unsafe extern "C" fn rsvg_handle_has_sub(
handle: *const RsvgHandle,
id: *const libc::c_char,
) -> glib_sys::gboolean {
@@ -1327,7 +1327,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_has_sub(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_render_cairo(
+pub unsafe extern "C" fn rsvg_handle_render_cairo(
handle: *const RsvgHandle,
cr: *mut cairo_sys::cairo_t,
) -> glib_sys::gboolean {
@@ -1352,7 +1352,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_render_cairo(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_render_cairo_sub(
+pub unsafe extern "C" fn rsvg_handle_render_cairo_sub(
handle: *const RsvgHandle,
cr: *mut cairo_sys::cairo_t,
id: *const libc::c_char,
@@ -1379,7 +1379,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_render_cairo_sub(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_pixbuf(
+pub unsafe extern "C" fn rsvg_handle_get_pixbuf(
handle: *const RsvgHandle,
) -> *mut gdk_pixbuf_sys::GdkPixbuf {
rsvg_return_val_if_fail! {
@@ -1400,7 +1400,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_pixbuf(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_pixbuf_sub(
+pub unsafe extern "C" fn rsvg_handle_get_pixbuf_sub(
handle: *const RsvgHandle,
id: *const libc::c_char,
) -> *mut gdk_pixbuf_sys::GdkPixbuf {
@@ -1423,15 +1423,15 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_pixbuf_sub(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_dimensions(
+pub unsafe extern "C" fn rsvg_handle_get_dimensions(
handle: *const RsvgHandle,
dimension_data: *mut RsvgDimensionData,
) {
- rsvg_rust_handle_get_dimensions_sub(handle, dimension_data, ptr::null());
+ rsvg_handle_get_dimensions_sub(handle, dimension_data, ptr::null());
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_dimensions_sub(
+pub unsafe extern "C" fn rsvg_handle_get_dimensions_sub(
handle: *const RsvgHandle,
dimension_data: *mut RsvgDimensionData,
id: *const libc::c_char,
@@ -1462,7 +1462,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_dimensions_sub(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_position_sub(
+pub unsafe extern "C" fn rsvg_handle_get_position_sub(
handle: *const RsvgHandle,
position_data: *mut RsvgPositionData,
id: *const libc::c_char,
@@ -1497,7 +1497,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_position_sub(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new() -> *const RsvgHandle {
+pub unsafe extern "C" fn rsvg_handle_new() -> *const RsvgHandle {
let obj: *mut gobject_sys::GObject = glib::Object::new(CHandle::get_type(), &[])
.unwrap()
.to_glib_full();
@@ -1506,7 +1506,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new() -> *const RsvgHandle {
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new_with_flags(flags: u32) -> *const RsvgHandle {
+pub unsafe extern "C" fn rsvg_handle_new_with_flags(flags: u32) -> *const RsvgHandle {
let obj: *mut gobject_sys::GObject =
glib::Object::new(CHandle::get_type(), &[("flags", &flags)])
.unwrap()
@@ -1516,7 +1516,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_with_flags(flags: u32) -> *const R
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new_from_file(
+pub unsafe extern "C" fn rsvg_handle_new_from_file(
filename: *const libc::c_char,
error: *mut *mut glib_sys::GError,
) -> *const RsvgHandle {
@@ -1538,11 +1538,11 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_file(
}
};
- rsvg_rust_handle_new_from_gfile_sync(file.to_glib_none().0, 0, ptr::null_mut(), error)
+ rsvg_handle_new_from_gfile_sync(file.to_glib_none().0, 0, ptr::null_mut(), error)
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new_from_gfile_sync(
+pub unsafe extern "C" fn rsvg_handle_new_from_gfile_sync(
file: *mut gio_sys::GFile,
flags: u32,
cancellable: *mut gio_sys::GCancellable,
@@ -1556,7 +1556,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_gfile_sync(
error.is_null() || (*error).is_null(),
}
- let raw_handle = rsvg_rust_handle_new_with_flags(flags);
+ let raw_handle = rsvg_handle_new_with_flags(flags);
let rhandle = get_rust_handle(raw_handle);
@@ -1582,7 +1582,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_gfile_sync(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new_from_stream_sync(
+pub unsafe extern "C" fn rsvg_handle_new_from_stream_sync(
input_stream: *mut gio_sys::GInputStream,
base_file: *mut gio_sys::GFile,
flags: u32,
@@ -1598,7 +1598,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_stream_sync(
error.is_null() || (*error).is_null(),
}
- let raw_handle = rsvg_rust_handle_new_with_flags(flags);
+ let raw_handle = rsvg_handle_new_with_flags(flags);
let rhandle = get_rust_handle(raw_handle);
@@ -1622,7 +1622,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_stream_sync(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_new_from_data(
+pub unsafe extern "C" fn rsvg_handle_new_from_data(
data: *mut u8,
data_len: usize,
error: *mut *mut glib_sys::GError,
@@ -1650,7 +1650,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_new_from_data(
let raw_stream = gio_sys::g_memory_input_stream_new_from_data(data, data_len, None);
- let ret = rsvg_rust_handle_new_from_stream_sync(
+ let ret = rsvg_handle_new_from_stream_sync(
raw_stream as *mut _,
ptr::null_mut(), // base_file
0, // flags
@@ -1683,12 +1683,12 @@ unsafe fn set_out_param<T: Copy>(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_free(handle: *mut RsvgHandle) {
+pub unsafe extern "C" fn rsvg_handle_free(handle: *mut RsvgHandle) {
gobject_sys::g_object_unref(handle as *mut _);
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_set_stylesheet(
+pub unsafe extern "C" fn rsvg_handle_set_stylesheet(
handle: *const RsvgHandle,
css: *const u8,
css_len: usize,
@@ -1728,7 +1728,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_stylesheet(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_intrinsic_dimensions(
+pub unsafe extern "C" fn rsvg_handle_get_intrinsic_dimensions(
handle: *const RsvgHandle,
out_has_width: *mut glib_sys::gboolean,
out_width: *mut RsvgLength,
@@ -1759,7 +1759,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_intrinsic_dimensions(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_render_document(
+pub unsafe extern "C" fn rsvg_handle_render_document(
handle: *const RsvgHandle,
cr: *mut cairo_sys::cairo_t,
viewport: *const RsvgRectangle,
@@ -1788,7 +1788,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_render_document(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_geometry_for_layer(
+pub unsafe extern "C" fn rsvg_handle_get_geometry_for_layer(
handle: *mut RsvgHandle,
id: *const libc::c_char,
viewport: *const RsvgRectangle,
@@ -1829,7 +1829,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_geometry_for_layer(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_render_layer(
+pub unsafe extern "C" fn rsvg_handle_render_layer(
handle: *const RsvgHandle,
cr: *mut cairo_sys::cairo_t,
id: *const libc::c_char,
@@ -1860,7 +1860,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_render_layer(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_geometry_for_element(
+pub unsafe extern "C" fn rsvg_handle_get_geometry_for_element(
handle: *const RsvgHandle,
id: *const libc::c_char,
out_ink_rect: *mut RsvgRectangle,
@@ -1899,7 +1899,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_geometry_for_element(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_render_element(
+pub unsafe extern "C" fn rsvg_handle_render_element(
handle: *const RsvgHandle,
cr: *mut cairo_sys::cairo_t,
id: *const libc::c_char,
@@ -1930,7 +1930,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_render_element(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_desc(handle: *const RsvgHandle) -> *mut libc::c_char {
+pub unsafe extern "C" fn rsvg_handle_get_desc(handle: *const RsvgHandle) -> *mut libc::c_char {
rsvg_return_val_if_fail! {
rsvg_handle_get_desc => ptr::null_mut();
@@ -1941,9 +1941,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_desc(handle: *const RsvgHandle) ->
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_metadata(
- handle: *const RsvgHandle,
-) -> *mut libc::c_char {
+pub unsafe extern "C" fn rsvg_handle_get_metadata(handle: *const RsvgHandle) -> *mut libc::c_char {
rsvg_return_val_if_fail! {
rsvg_handle_get_metadata => ptr::null_mut();
@@ -1954,9 +1952,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_metadata(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_handle_get_title(
- handle: *const RsvgHandle,
-) -> *mut libc::c_char {
+pub unsafe extern "C" fn rsvg_handle_get_title(handle: *const RsvgHandle) -> *mut libc::c_char {
rsvg_return_val_if_fail! {
rsvg_handle_get_title => ptr::null_mut();
@@ -1967,13 +1963,13 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_title(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_init() {}
+pub unsafe extern "C" fn rsvg_init() {}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_term() {}
+pub unsafe extern "C" fn rsvg_term() {}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_cleanup() {}
+pub unsafe extern "C" fn rsvg_cleanup() {}
/// Detects whether a `*const libc::c_char` is a path or a URI
///
@@ -2043,7 +2039,7 @@ pub(crate) fn set_gerror(err: *mut *mut glib_sys::GError, code: u32, msg: &str)
glib_sys::g_set_error_literal(
err,
- rsvg_rust_error_quark(),
+ rsvg_error_quark(),
code as libc::c_int,
msg.to_glib_none().0,
);
@@ -2078,7 +2074,7 @@ impl ErrorDomain for RsvgError {
}
#[no_mangle]
-pub extern "C" fn rsvg_rust_error_quark() -> glib_sys::GQuark {
+pub extern "C" fn rsvg_error_quark() -> glib_sys::GQuark {
RsvgError::domain().to_glib()
}
diff --git a/librsvg/dpi.rs b/librsvg/dpi.rs
index 820f1da3..ea0bcf24 100644
--- a/librsvg/dpi.rs
+++ b/librsvg/dpi.rs
@@ -52,7 +52,7 @@ impl From<Dpi> for rsvg_internals::Dpi {
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_set_default_dpi_x_y(dpi_x: f64, dpi_y: f64) {
+pub unsafe extern "C" fn rsvg_set_default_dpi_x_y(dpi_x: f64, dpi_y: f64) {
if dpi_x <= 0.0 {
DPI_X = DEFAULT_DPI_X;
} else {
@@ -65,3 +65,14 @@ pub unsafe extern "C" fn rsvg_rust_set_default_dpi_x_y(dpi_x: f64, dpi_y: f64) {
DPI_Y = dpi_y;
}
}
+
+#[no_mangle]
+pub unsafe extern "C" fn rsvg_set_default_dpi(dpi: f64) {
+ if dpi <= 0.0 {
+ DPI_X = DEFAULT_DPI_X;
+ DPI_Y = DEFAULT_DPI_Y;
+ } else {
+ DPI_X = dpi;
+ DPI_Y = dpi;
+ }
+}
diff --git a/librsvg/lib.rs b/librsvg/lib.rs
index 8e239c3b..d6beaf21 100644
--- a/librsvg/lib.rs
+++ b/librsvg/lib.rs
@@ -3,46 +3,47 @@
#[rustfmt::skip]
pub use crate::c_api::{
- rsvg_rust_error_get_type,
- rsvg_rust_handle_close,
- rsvg_rust_handle_flags_get_type,
- rsvg_rust_handle_get_base_url,
- rsvg_rust_handle_get_dimensions,
- rsvg_rust_handle_get_dimensions_sub,
- rsvg_rust_handle_get_geometry_for_element,
- rsvg_rust_handle_get_geometry_for_layer,
- rsvg_rust_handle_get_intrinsic_dimensions,
- rsvg_rust_handle_get_pixbuf_sub,
- rsvg_rust_handle_get_position_sub,
- rsvg_rust_handle_has_sub,
- rsvg_rust_handle_new_from_data,
- rsvg_rust_handle_new_from_file,
- rsvg_rust_handle_new_from_gfile_sync,
- rsvg_rust_handle_new_from_stream_sync,
- rsvg_rust_handle_new_with_flags,
- rsvg_rust_handle_read_stream_sync,
- rsvg_rust_handle_render_cairo_sub,
- rsvg_rust_handle_render_element,
- rsvg_rust_handle_render_document,
- rsvg_rust_handle_render_layer,
- rsvg_rust_handle_set_base_gfile,
- rsvg_rust_handle_set_base_url,
- rsvg_rust_handle_set_dpi_x_y,
- rsvg_rust_handle_set_size_callback,
- rsvg_rust_handle_set_testing,
- rsvg_rust_handle_write,
+ rsvg_error_get_type,
+ rsvg_handle_close,
+ rsvg_handle_flags_get_type,
+ rsvg_handle_get_base_uri,
+ rsvg_handle_get_dimensions,
+ rsvg_handle_get_dimensions_sub,
+ rsvg_handle_get_geometry_for_element,
+ rsvg_handle_get_geometry_for_layer,
+ rsvg_handle_get_intrinsic_dimensions,
+ rsvg_handle_get_pixbuf_sub,
+ rsvg_handle_get_position_sub,
+ rsvg_handle_has_sub,
+ rsvg_handle_internal_set_testing,
+ rsvg_handle_new_from_data,
+ rsvg_handle_new_from_file,
+ rsvg_handle_new_from_gfile_sync,
+ rsvg_handle_new_from_stream_sync,
+ rsvg_handle_new_with_flags,
+ rsvg_handle_read_stream_sync,
+ rsvg_handle_render_cairo_sub,
+ rsvg_handle_render_element,
+ rsvg_handle_render_document,
+ rsvg_handle_render_layer,
+ rsvg_handle_set_base_gfile,
+ rsvg_handle_set_base_uri,
+ rsvg_handle_set_dpi_x_y,
+ rsvg_handle_set_size_callback,
+ rsvg_handle_write,
};
pub use crate::color_utils::rsvg_css_parse_color;
-pub use crate::dpi::rsvg_rust_set_default_dpi_x_y;
+pub use crate::dpi::{rsvg_set_default_dpi, rsvg_set_default_dpi_x_y};
#[rustfmt::skip]
pub use crate::pixbuf_utils::{
- rsvg_rust_pixbuf_from_file_at_max_size,
- rsvg_rust_pixbuf_from_file_at_size,
- rsvg_rust_pixbuf_from_file_at_zoom,
- rsvg_rust_pixbuf_from_file_at_zoom_with_max,
+ rsvg_pixbuf_from_file,
+ rsvg_pixbuf_from_file_at_max_size,
+ rsvg_pixbuf_from_file_at_size,
+ rsvg_pixbuf_from_file_at_zoom,
+ rsvg_pixbuf_from_file_at_zoom_with_max,
};
#[macro_use]
diff --git a/librsvg/pixbuf_utils.rs b/librsvg/pixbuf_utils.rs
index 6e4f1715..41dcd60d 100644
--- a/librsvg/pixbuf_utils.rs
+++ b/librsvg/pixbuf_utils.rs
@@ -269,7 +269,32 @@ fn pixbuf_from_file_with_size_mode(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_size(
+pub unsafe extern "C" fn rsvg_pixbuf_from_file(
+ filename: *const libc::c_char,
+ error: *mut *mut glib_sys::GError,
+) -> *mut gdk_pixbuf_sys::GdkPixbuf {
+ rsvg_return_val_if_fail! {
+ rsvg_pixbuf_from_file => ptr::null_mut();
+
+ !filename.is_null(),
+ error.is_null() || (*error).is_null(),
+ }
+
+ pixbuf_from_file_with_size_mode(
+ filename,
+ &SizeMode {
+ kind: SizeKind::WidthHeight,
+ x_zoom: 0.0,
+ y_zoom: 0.0,
+ width: -1,
+ height: -1,
+ },
+ error,
+ )
+}
+
+#[no_mangle]
+pub unsafe extern "C" fn rsvg_pixbuf_from_file_at_size(
filename: *const libc::c_char,
width: i32,
height: i32,
@@ -297,7 +322,7 @@ pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_size(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_zoom(
+pub unsafe extern "C" fn rsvg_pixbuf_from_file_at_zoom(
filename: *const libc::c_char,
x_zoom: f64,
y_zoom: f64,
@@ -325,7 +350,7 @@ pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_zoom(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_zoom_with_max(
+pub unsafe extern "C" fn rsvg_pixbuf_from_file_at_zoom_with_max(
filename: *const libc::c_char,
x_zoom: f64,
y_zoom: f64,
@@ -356,7 +381,7 @@ pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_zoom_with_max(
}
#[no_mangle]
-pub unsafe extern "C" fn rsvg_rust_pixbuf_from_file_at_max_size(
+pub unsafe extern "C" fn rsvg_pixbuf_from_file_at_max_size(
filename: *const libc::c_char,
max_width: i32,
max_height: i32,
diff --git a/librsvg/rsvg-base.c b/librsvg/rsvg-base.c
index b2280695..7b1bc98b 100644
--- a/librsvg/rsvg-base.c
+++ b/librsvg/rsvg-base.c
@@ -23,22 +23,6 @@
Author: Raph Levien <raph artofcode com>
*/
-#include "config.h"
-
-#include "rsvg.h"
-#include "rsvg-css.h"
-
-/* Implemented in rsvg_internals/src/dpi.rs */
-extern void rsvg_rust_set_default_dpi_x_y(double dpi_x, double dpi_y);
-
-/* Implemented in rsvg_internals/src/error.rs */
-extern GQuark rsvg_rust_error_quark (void);
-
-/* Implemented in librsvg/c_api.rs */
-extern void rsvg_rust_init (void);
-extern void rsvg_rust_term (void);
-extern void rsvg_rust_cleanup (void);
-
/**
* rsvg_error_quark:
*
@@ -46,11 +30,6 @@ extern void rsvg_rust_cleanup (void);
*
* Returns: The error domain
*/
-GQuark
-rsvg_error_quark (void)
-{
- return rsvg_rust_error_quark ();
-}
/**
* rsvg_set_default_dpi:
@@ -66,11 +45,6 @@ rsvg_error_quark (void)
* created; it would not work after that. To avoid global mutable state, please
* use rsvg_handle_set_dpi() instead.
*/
-void
-rsvg_set_default_dpi (double dpi)
-{
- rsvg_rust_set_default_dpi_x_y (dpi, dpi);
-}
/**
* rsvg_set_default_dpi_x_y:
@@ -87,11 +61,6 @@ rsvg_set_default_dpi (double dpi)
* created; it would not work after that. To avoid global mutable state, please
* use rsvg_handle_set_dpi() instead.
*/
-void
-rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y)
-{
- rsvg_rust_set_default_dpi_x_y (dpi_x, dpi_y);
-}
/**
* rsvg_init:
@@ -101,11 +70,6 @@ rsvg_set_default_dpi_x_y (double dpi_x, double dpi_y)
* Since: 2.9
* Deprecated: 2.36: There is no need to initialize librsvg.
**/
-void
-rsvg_init (void)
-{
- rsvg_rust_init ();
-}
/**
* rsvg_term:
@@ -115,11 +79,6 @@ rsvg_init (void)
* Since: 2.9
* Deprecated: 2.36: There is no need to de-initialize librsvg.
**/
-void
-rsvg_term (void)
-{
- rsvg_rust_term ();
-}
/**
* rsvg_cleanup:
@@ -128,17 +87,3 @@ rsvg_term (void)
*
* Since: 2.36
**/
-void
-rsvg_cleanup (void)
-{
- rsvg_rust_cleanup ();
-}
-
-/* This is defined like this so that we can export the Rust function... just for
- * the benefit of rsvg-convert.c
- */
-RsvgCssColorSpec
-rsvg_css_parse_color_ (const char *str)
-{
- return rsvg_css_parse_color (str);
-}
diff --git a/librsvg/rsvg-css.h b/librsvg/rsvg-css.h
index 93090b9b..dfca15b0 100644
--- a/librsvg/rsvg-css.h
+++ b/librsvg/rsvg-css.h
@@ -48,7 +48,7 @@ typedef struct {
/* This one is semi-public for mis-use in rsvg-convert */
RSVG_API
-RsvgCssColorSpec rsvg_css_parse_color_ (const char *str);
+RsvgCssColorSpec rsvg_css_parse_color (const char *str);
#ifdef RSVG_COMPILATION
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index 95364db3..3f567443 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -311,119 +311,6 @@
/***** End documentation for RsvgHandle properties *****/
-#include "config.h"
-#define _GNU_SOURCE 1
-
-#include <string.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <glib/gprintf.h>
-#include <glib/gi18n-lib.h>
-
-#include "rsvg.h"
-
-/* Implemented in rsvg_internals/src/handle.rs */
-extern void rsvg_rust_handle_set_dpi (RsvgHandle *handle, double dpi);
-extern void rsvg_rust_handle_set_dpi_x_y (RsvgHandle *handle, double dpi_x, double dpi_y);
-extern void rsvg_rust_handle_set_base_url (RsvgHandle *handle, const char *uri);
-extern void rsvg_rust_handle_set_base_gfile (RsvgHandle *handle, GFile *file);
-extern const char *rsvg_rust_handle_get_base_url (RsvgHandle *handle);
-extern guint rsvg_rust_handle_set_testing (RsvgHandle *handle, gboolean testing);
-extern gboolean rsvg_rust_handle_read_stream_sync (RsvgHandle *handle,
- GInputStream *stream,
- GCancellable *cancellable,
- GError **error);
-extern gboolean rsvg_rust_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **error);
-extern gboolean rsvg_rust_handle_close (RsvgHandle *handle, GError **error);
-extern gboolean rsvg_rust_handle_has_sub (RsvgHandle *handle, const char *id);
-extern gboolean rsvg_rust_handle_render_cairo (RsvgHandle *handle, cairo_t *cr);
-extern gboolean rsvg_rust_handle_render_cairo_sub (RsvgHandle *handle,
- cairo_t *cr,
- const char *id);
-extern GdkPixbuf *rsvg_rust_handle_get_pixbuf (RsvgHandle *handle);
-extern GdkPixbuf *rsvg_rust_handle_get_pixbuf_sub (RsvgHandle *handle, const char *id);
-extern void rsvg_rust_handle_get_dimensions (RsvgHandle *handle,
- RsvgDimensionData *dimension_data);
-extern gboolean rsvg_rust_handle_get_dimensions_sub (RsvgHandle *handle,
- RsvgDimensionData *dimension_data,
- const char *id);
-extern gboolean rsvg_rust_handle_get_position_sub (RsvgHandle *handle,
- RsvgPositionData *dimension_data,
- const char *id);
-extern void rsvg_rust_handle_set_size_callback (RsvgHandle *handle,
- RsvgSizeFunc size_func,
- gpointer user_data,
- GDestroyNotify destroy_notify);
-extern RsvgHandle *rsvg_rust_handle_new (void);
-extern RsvgHandle *rsvg_rust_handle_new_with_flags (RsvgHandleFlags flags);
-extern RsvgHandle *rsvg_rust_handle_new_from_file (const char *filename,
- GError **error);
-extern RsvgHandle *rsvg_rust_handle_new_from_gfile_sync (GFile *file,
- RsvgHandleFlags flags,
- GCancellable *cancellable,
- GError **error);
-extern RsvgHandle *rsvg_rust_handle_new_from_stream_sync (GInputStream *input_stream,
- GFile *base_file,
- RsvgHandleFlags flags,
- GCancellable *cancellable,
- GError **error);
-extern RsvgHandle *rsvg_rust_handle_new_from_data (const guint8 *data,
- gsize data_len,
- GError **error);
-extern void rsvg_rust_handle_free (RsvgHandle *handle);
-extern gboolean rsvg_rust_handle_set_stylesheet (RsvgHandle *handle,
- const char *css,
- gsize css_len,
- GError **error);
-
-extern void rsvg_rust_handle_get_intrinsic_dimensions (RsvgHandle *handle,
- gboolean *out_has_width,
- RsvgLength *out_width,
- gboolean *out_has_height,
- RsvgLength *out_height,
- gboolean *out_has_viewbox,
- RsvgRectangle *out_viewbox);
-extern gboolean rsvg_rust_handle_render_document (RsvgHandle *handle,
- cairo_t *cr,
- const RsvgRectangle *viewport,
- GError **error);
-extern gboolean rsvg_rust_handle_get_geometry_for_layer (RsvgHandle *handle,
- const char *id,
- const RsvgRectangle *viewport,
- RsvgRectangle *out_ink_rect,
- RsvgRectangle *out_logical_rect,
- GError **error);
-extern gboolean rsvg_rust_handle_render_layer (RsvgHandle *handle,
- cairo_t *cr,
- const char *id,
- const RsvgRectangle *viewport,
- GError **error);
-extern gboolean rsvg_rust_handle_get_geometry_for_element (RsvgHandle *handle,
- const char *id,
- RsvgRectangle *out_ink_rect,
- RsvgRectangle *out_logical_rect,
- GError **error);
-extern gboolean rsvg_rust_handle_render_element (RsvgHandle *handle,
- cairo_t *cr,
- const char *id,
- const RsvgRectangle *element_viewport,
- GError **error);
-extern const char *rsvg_rust_handle_get_desc (RsvgHandle *handle);
-extern const char *rsvg_rust_handle_get_metadata (RsvgHandle *handle);
-extern const char *rsvg_rust_handle_get_title (RsvgHandle *handle);
-
-
-/* Implemented in librsvg/c_api.rs */
-extern GType rsvg_rust_error_get_type (void);
-extern GType rsvg_rust_handle_get_type (void);
-extern GType rsvg_rust_handle_flags_get_type (void);
-
-GType
-rsvg_handle_get_type (void)
-{
- return rsvg_rust_handle_get_type ();
-}
-
/**
* rsvg_handle_free:
* @handle: An #RsvgHandle
@@ -431,11 +318,6 @@ rsvg_handle_get_type (void)
* Frees @handle.
* Deprecated: Use g_object_unref() instead.
**/
-void
-rsvg_handle_free (RsvgHandle *handle)
-{
- rsvg_rust_handle_free (handle);
-}
/**
* rsvg_handle_new:
@@ -463,11 +345,6 @@ rsvg_handle_free (RsvgHandle *handle)
*
* Returns: A new #RsvgHandle with no flags set.
**/
-RsvgHandle *
-rsvg_handle_new (void)
-{
- return rsvg_rust_handle_new();
-}
/**
* rsvg_handle_new_from_data:
@@ -483,11 +360,6 @@ rsvg_handle_new (void)
* Returns: A #RsvgHandle or %NULL if an error occurs.
* Since: 2.14
*/
-RsvgHandle *
-rsvg_handle_new_from_data (const guint8 *data, gsize data_len, GError **error)
-{
- return rsvg_rust_handle_new_from_data (data, data_len, error);
-}
/**
* rsvg_handle_new_from_file:
@@ -502,11 +374,6 @@ rsvg_handle_new_from_data (const guint8 *data, gsize data_len, GError **error)
* Returns: A #RsvgHandle or %NULL if an error occurs.
* Since: 2.14
*/
-RsvgHandle *
-rsvg_handle_new_from_file (const gchar *filename, GError **error)
-{
- return rsvg_rust_handle_new_from_file (filename, error);
-}
/**
* rsvg_handle_new_with_flags:
@@ -520,11 +387,6 @@ rsvg_handle_new_from_file (const gchar *filename, GError **error)
*
* Since: 2.36
**/
-RsvgHandle *
-rsvg_handle_new_with_flags (RsvgHandleFlags flags)
-{
- return rsvg_rust_handle_new_with_flags (flags);
-}
/**
* rsvg_handle_new_from_gfile_sync:
@@ -548,14 +410,6 @@ rsvg_handle_new_with_flags (RsvgHandleFlags flags)
*
* Since: 2.32
*/
-RsvgHandle *
-rsvg_handle_new_from_gfile_sync (GFile *file,
- RsvgHandleFlags flags,
- GCancellable *cancellable,
- GError **error)
-{
- return rsvg_rust_handle_new_from_gfile_sync (file, flags, cancellable, error);
-}
/**
* rsvg_handle_new_from_stream_sync:
@@ -580,19 +434,6 @@ rsvg_handle_new_from_gfile_sync (GFile *file,
*
* Since: 2.32
*/
-RsvgHandle *
-rsvg_handle_new_from_stream_sync (GInputStream *input_stream,
- GFile *base_file,
- RsvgHandleFlags flags,
- GCancellable *cancellable,
- GError **error)
-{
- return rsvg_rust_handle_new_from_stream_sync (input_stream,
- base_file,
- flags,
- cancellable,
- error);
-}
/**
* rsvg_handle_write:
@@ -618,11 +459,6 @@ rsvg_handle_new_from_stream_sync (GInputStream *input_stream,
* called. To avoid a big temporary buffer, use the suggested functions, which
* take a #GFile or a #GInputStream and do not require a temporary buffer.
**/
-gboolean
-rsvg_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **error)
-{
- return rsvg_rust_handle_write (handle, buf, count, error);
-}
/**
* rsvg_handle_close:
@@ -640,11 +476,6 @@ rsvg_handle_write (RsvgHandle *handle, const guchar *buf, gsize count, GError **
* rsvg_handle_new_from_stream_sync(). See the deprecation notes for
* rsvg_handle_write() for more information.
**/
-gboolean
-rsvg_handle_close (RsvgHandle *handle, GError **error)
-{
- return rsvg_rust_handle_close(handle, error);
-}
/**
* rsvg_handle_read_stream_sync:
@@ -671,17 +502,6 @@ rsvg_handle_close (RsvgHandle *handle, GError **error)
*
* Since: 2.32
*/
-gboolean
-rsvg_handle_read_stream_sync (RsvgHandle *handle,
- GInputStream *stream,
- GCancellable *cancellable,
- GError **error)
-{
- return rsvg_rust_handle_read_stream_sync (handle,
- stream,
- cancellable,
- error);
-}
/**
* rsvg_handle_set_base_uri:
@@ -695,11 +515,6 @@ rsvg_handle_read_stream_sync (RsvgHandle *handle,
*
* Since: 2.9
*/
-void
-rsvg_handle_set_base_uri (RsvgHandle *handle, const char *base_uri)
-{
- rsvg_rust_handle_set_base_url (handle, base_uri);
-}
/**
* rsvg_handle_set_base_gfile:
@@ -713,12 +528,6 @@ rsvg_handle_set_base_uri (RsvgHandle *handle, const char *base_uri)
*
* Since: 2.32
*/
-void
-rsvg_handle_set_base_gfile (RsvgHandle *handle,
- GFile *base_file)
-{
- rsvg_rust_handle_set_base_gfile (handle, base_file);
-}
/**
* rsvg_handle_get_base_uri:
@@ -729,11 +538,6 @@ rsvg_handle_set_base_gfile (RsvgHandle *handle,
* Returns: the base uri, possibly null
* Since: 2.8
*/
-const char *
-rsvg_handle_get_base_uri (RsvgHandle *handle)
-{
- return rsvg_rust_handle_get_base_url (handle);
-}
/**
* rsvg_handle_set_stylesheet:
@@ -756,14 +560,6 @@ rsvg_handle_get_base_uri (RsvgHandle *handle)
*
* Since: 2.48
*/
-gboolean
-rsvg_handle_set_stylesheet (RsvgHandle *handle,
- const guint8 *css,
- gsize css_len,
- GError **error)
-{
- return rsvg_rust_handle_set_stylesheet (handle, css, css_len, error);
-}
/**
* rsvg_handle_get_metadata:
@@ -776,11 +572,6 @@ rsvg_handle_set_stylesheet (RsvgHandle *handle,
* Deprecated: 2.36. Librsvg does not read the metadata/desc/title elements;
* this function always returns #NULL.
*/
-const char *
-rsvg_handle_get_metadata (RsvgHandle * handle)
-{
- return rsvg_rust_handle_get_metadata (handle);
-}
/**
* rsvg_handle_get_title:
@@ -793,11 +584,6 @@ rsvg_handle_get_metadata (RsvgHandle * handle)
* Deprecated: 2.36. Librsvg does not read the metadata/desc/title elements;
* this function always returns #NULL.
*/
-const char *
-rsvg_handle_get_title (RsvgHandle *handle)
-{
- return rsvg_rust_handle_get_title (handle);
-}
/**
* rsvg_handle_get_desc:
@@ -810,11 +596,6 @@ rsvg_handle_get_title (RsvgHandle *handle)
* Deprecated: 2.36. Librsvg does not read the metadata/desc/title elements;
* this function always returns #NULL.
*/
-const char *
-rsvg_handle_get_desc (RsvgHandle *handle)
-{
- return rsvg_rust_handle_get_desc (handle);
-}
/**
* rsvg_handle_render_cairo_sub:
@@ -844,11 +625,6 @@ rsvg_handle_get_desc (RsvgHandle *handle)
* Returns: %TRUE if drawing succeeded; %FALSE otherwise.
* Since: 2.14
*/
-gboolean
-rsvg_handle_render_cairo_sub (RsvgHandle *handle, cairo_t *cr, const char *id)
-{
- return rsvg_rust_handle_render_cairo_sub (handle, cr, id);
-}
/**
* rsvg_handle_render_cairo:
@@ -871,11 +647,6 @@ rsvg_handle_render_cairo_sub (RsvgHandle *handle, cairo_t *cr, const char *id)
* Returns: %TRUE if drawing succeeded; %FALSE otherwise.
* Since: 2.14
*/
-gboolean
-rsvg_handle_render_cairo (RsvgHandle *handle, cairo_t *cr)
-{
- return rsvg_rust_handle_render_cairo (handle, cr);
-}
/**
* rsvg_handle_get_dimensions:
@@ -890,11 +661,6 @@ rsvg_handle_render_cairo (RsvgHandle *handle, cairo_t *cr)
*
* Since: 2.14
*/
-void
-rsvg_handle_get_dimensions (RsvgHandle *handle, RsvgDimensionData *dimension_data)
-{
- rsvg_rust_handle_get_dimensions (handle, dimension_data);
-}
/**
* rsvg_handle_get_dimensions_sub:
@@ -918,13 +684,6 @@ rsvg_handle_get_dimensions (RsvgHandle *handle, RsvgDimensionData *dimension_dat
*
* Since: 2.22
*/
-gboolean
-rsvg_handle_get_dimensions_sub (RsvgHandle *handle,
- RsvgDimensionData *dimension_data,
- const char *id)
-{
- return rsvg_rust_handle_get_dimensions_sub (handle, dimension_data, id);
-}
/**
* rsvg_handle_get_position_sub:
@@ -948,13 +707,6 @@ rsvg_handle_get_dimensions_sub (RsvgHandle *handle,
*
* Since: 2.22
*/
-gboolean
-rsvg_handle_get_position_sub (RsvgHandle *handle,
- RsvgPositionData *position_data,
- const char *id)
-{
- return rsvg_rust_handle_get_position_sub (handle, position_data, id);
-}
/**
* rsvg_handle_has_sub:
@@ -973,11 +725,6 @@ rsvg_handle_get_position_sub (RsvgHandle *handle,
*
* Since: 2.22
*/
-gboolean
-rsvg_handle_has_sub (RsvgHandle *handle, const char *id)
-{
- return rsvg_rust_handle_has_sub (handle, id);
-}
/**
* rsvg_handle_get_pixbuf_sub:
@@ -1009,11 +756,6 @@ rsvg_handle_has_sub (RsvgHandle *handle, const char *id)
*
* Since: 2.14
**/
-GdkPixbuf *
-rsvg_handle_get_pixbuf_sub (RsvgHandle *handle, const char *id)
-{
- return rsvg_rust_handle_get_pixbuf_sub (handle, id);
-}
/**
* rsvg_handle_get_pixbuf:
@@ -1030,11 +772,6 @@ rsvg_handle_get_pixbuf_sub (RsvgHandle *handle, const char *id)
*
* Returns: (transfer full) (nullable): the pixbuf loaded by @handle, or %NULL.
**/
-GdkPixbuf *
-rsvg_handle_get_pixbuf (RsvgHandle *handle)
-{
- return rsvg_rust_handle_get_pixbuf (handle);
-}
/**
* rsvg_handle_set_dpi:
@@ -1050,11 +787,6 @@ rsvg_handle_get_pixbuf (RsvgHandle *handle)
*
* Since: 2.8
*/
-void
-rsvg_handle_set_dpi (RsvgHandle *handle, double dpi)
-{
- rsvg_rust_handle_set_dpi (handle, dpi);
-}
/**
* rsvg_handle_set_dpi_x_y:
@@ -1071,11 +803,6 @@ rsvg_handle_set_dpi (RsvgHandle *handle, double dpi)
*
* Since: 2.8
*/
-void
-rsvg_handle_set_dpi_x_y (RsvgHandle *handle, double dpi_x, double dpi_y)
-{
- rsvg_rust_handle_set_dpi_x_y (handle, dpi_x, dpi_y);
-}
/**
* rsvg_handle_set_size_callback:
@@ -1134,17 +861,6 @@ rsvg_handle_set_dpi_x_y (RsvgHandle *handle, double dpi_x, double dpi_y)
* refers to the whole SVG or to just a sub-element of it. It is easier, and
* unambiguous, to use code similar to the example above.
**/
-void
-rsvg_handle_set_size_callback (RsvgHandle *handle,
- RsvgSizeFunc size_func,
- gpointer user_data,
- GDestroyNotify user_data_destroy)
-{
- rsvg_rust_handle_set_size_callback (handle,
- size_func,
- user_data,
- user_data_destroy);
-}
/**
* rsvg_handle_get_intrinsic_dimensions:
@@ -1190,23 +906,6 @@ rsvg_handle_set_size_callback (RsvgHandle *handle,
*
* Since: 2.46
*/
-void
-rsvg_handle_get_intrinsic_dimensions (RsvgHandle *handle,
- gboolean *out_has_width,
- RsvgLength *out_width,
- gboolean *out_has_height,
- RsvgLength *out_height,
- gboolean *out_has_viewbox,
- RsvgRectangle *out_viewbox)
-{
- rsvg_rust_handle_get_intrinsic_dimensions (handle,
- out_has_width,
- out_width,
- out_has_height,
- out_height,
- out_has_viewbox,
- out_viewbox);
-}
/**
* rsvg_handle_render_document:
@@ -1230,14 +929,6 @@ rsvg_handle_get_intrinsic_dimensions (RsvgHandle *handle,
*
* Since: 2.46
*/
-gboolean
-rsvg_handle_render_document (RsvgHandle *handle,
- cairo_t *cr,
- const RsvgRectangle *viewport,
- GError **error)
-{
- return rsvg_rust_handle_render_document (handle, cr, viewport, error);
-}
/**
* rsvg_handle_get_geometry_for_layer:
@@ -1281,21 +972,6 @@ rsvg_handle_render_document (RsvgHandle *handle,
*
* Since: 2.46
*/
-gboolean
-rsvg_handle_get_geometry_for_layer (RsvgHandle *handle,
- const char *id,
- const RsvgRectangle *viewport,
- RsvgRectangle *out_ink_rect,
- RsvgRectangle *out_logical_rect,
- GError **error)
-{
- return rsvg_rust_handle_get_geometry_for_layer (handle,
- id,
- viewport,
- out_ink_rect,
- out_logical_rect,
- error);
-}
/**
* rsvg_handle_render_layer:
@@ -1331,15 +1007,6 @@ rsvg_handle_get_geometry_for_layer (RsvgHandle *handle,
*
* Since: 2.46
*/
-gboolean
-rsvg_handle_render_layer (RsvgHandle *handle,
- cairo_t *cr,
- const char *id,
- const RsvgRectangle *viewport,
- GError **error)
-{
- return rsvg_rust_handle_render_layer (handle, cr, id, viewport, error);
-}
/**
* rsvg_handle_get_geometry_for_element:
@@ -1388,19 +1055,6 @@ rsvg_handle_render_layer (RsvgHandle *handle,
*
* Since: 2.46
*/
-gboolean
-rsvg_handle_get_geometry_for_element (RsvgHandle *handle,
- const char *id,
- RsvgRectangle *out_ink_rect,
- RsvgRectangle *out_logical_rect,
- GError **error)
-{
- return rsvg_rust_handle_get_geometry_for_element (handle,
- id,
- out_ink_rect,
- out_logical_rect,
- error);
-}
/**
* rsvg_handle_render_element:
@@ -1437,15 +1091,6 @@ rsvg_handle_get_geometry_for_element (RsvgHandle *handle,
*
* Since: 2.46
*/
-gboolean
-rsvg_handle_render_element (RsvgHandle *handle,
- cairo_t *cr,
- const char *id,
- const RsvgRectangle *element_viewport,
- GError **error)
-{
- return rsvg_rust_handle_render_element (handle, cr, id, element_viewport, error);
-}
/**
* rsvg_handle_internal_set_testing:
@@ -1455,20 +1100,3 @@ rsvg_handle_render_element (RsvgHandle *handle,
* Do not call this function. This is intended for librsvg's internal
* test suite only.
**/
-void
-rsvg_handle_internal_set_testing (RsvgHandle *handle, gboolean testing)
-{
- rsvg_rust_handle_set_testing (handle, testing);
-}
-
-GType
-rsvg_error_get_type(void)
-{
- return rsvg_rust_error_get_type();
-}
-
-GType
-rsvg_handle_flags_get_type(void)
-{
- return rsvg_rust_handle_flags_get_type();
-}
diff --git a/librsvg/rsvg-pixbuf.c b/librsvg/rsvg-pixbuf.c
index e86db8e7..8b8e4d0f 100644
--- a/librsvg/rsvg-pixbuf.c
+++ b/librsvg/rsvg-pixbuf.c
@@ -32,34 +32,6 @@
* cross-platform GTK+ widget toolkit.
*/
-#include "config.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "rsvg.h"
-
-/* Defined in rsvg_internals/src/pixbuf_utils.rs */
-extern GdkPixbuf *rsvg_rust_pixbuf_from_file_at_size (const char *filename,
- int width,
- int height,
- GError **error);
-extern GdkPixbuf *rsvg_rust_pixbuf_from_file_at_zoom (const char *filename,
- double x_zoom,
- double y_zoom,
- GError **error);
-extern GdkPixbuf *rsvg_rust_pixbuf_from_file_at_zoom_with_max (const char *filename,
- double x_zoom,
- double y_zoom,
- int max_width,
- int max_height,
- GError **error);
-extern GdkPixbuf *rsvg_rust_pixbuf_from_file_at_max_size (const char *filename,
- int max_width,
- int max_height,
- GError **error);
-
/**
* rsvg_pixbuf_from_file:
* @filename: A file name
@@ -72,11 +44,6 @@ extern GdkPixbuf *rsvg_rust_pixbuf_from_file_at_max_size (const char *filename,
* Return value: A newly allocated #GdkPixbuf, or %NULL
* Deprecated: Set up a cairo matrix and use rsvg_handle_new_from_file() + rsvg_handle_render_cairo()
instead.
**/
-GdkPixbuf *
-rsvg_pixbuf_from_file (const gchar *filename, GError **error)
-{
- return rsvg_rust_pixbuf_from_file_at_size (filename, -1, -1, error);
-}
/**
* rsvg_pixbuf_from_file_at_zoom:
@@ -93,14 +60,6 @@ rsvg_pixbuf_from_file (const gchar *filename, GError **error)
* Return value: A newly allocated #GdkPixbuf, or %NULL
* Deprecated: Set up a cairo matrix and use rsvg_handle_new_from_file() + rsvg_handle_render_cairo()
instead.
**/
-GdkPixbuf *
-rsvg_pixbuf_from_file_at_zoom (const gchar *filename,
- double x_zoom,
- double y_zoom,
- GError **error)
-{
- return rsvg_rust_pixbuf_from_file_at_zoom (filename, x_zoom, y_zoom, error);
-}
/**
* rsvg_pixbuf_from_file_at_zoom_with_max:
@@ -120,16 +79,6 @@ rsvg_pixbuf_from_file_at_zoom (const gchar *filename,
* Return value: A newly allocated #GdkPixbuf, or %NULL
* Deprecated: Set up a cairo matrix and use rsvg_handle_new_from_file() + rsvg_handle_render_cairo()
instead.
**/
-GdkPixbuf *
-rsvg_pixbuf_from_file_at_zoom_with_max (const gchar *filename,
- double x_zoom,
- double y_zoom,
- gint max_width,
- gint max_height,
- GError **error)
-{
- return rsvg_rust_pixbuf_from_file_at_zoom_with_max (filename, x_zoom, y_zoom, max_width, max_height,
error);
-}
/**
* rsvg_pixbuf_from_file_at_size:
@@ -147,14 +96,6 @@ rsvg_pixbuf_from_file_at_zoom_with_max (const gchar *filename,
* Return value: A newly allocated #GdkPixbuf, or %NULL
* Deprecated: Set up a cairo matrix and use rsvg_handle_new_from_file() + rsvg_handle_render_cairo()
instead.
**/
-GdkPixbuf *
-rsvg_pixbuf_from_file_at_size (const gchar *filename,
- gint width,
- gint height,
- GError **error)
-{
- return rsvg_rust_pixbuf_from_file_at_size (filename, width, height, error);
-}
/**
* rsvg_pixbuf_from_file_at_max_size:
@@ -171,11 +112,3 @@ rsvg_pixbuf_from_file_at_size (const gchar *filename,
* Return value: A newly allocated #GdkPixbuf, or %NULL
* Deprecated: Set up a cairo matrix and use rsvg_handle_new_from_file() + rsvg_handle_render_cairo()
instead.
**/
-GdkPixbuf *
-rsvg_pixbuf_from_file_at_max_size (const gchar *filename,
- gint max_width,
- gint max_height,
- GError **error)
-{
- return rsvg_rust_pixbuf_from_file_at_max_size(filename, max_width, max_height, error);
-}
diff --git a/rsvg-convert.c b/rsvg-convert.c
index 547b7972..cb17345d 100644
--- a/rsvg-convert.c
+++ b/rsvg-convert.c
@@ -569,7 +569,7 @@ main (int argc, char **argv)
if (background_color_str && g_ascii_strcasecmp(background_color_str, "none") != 0) {
RsvgCssColorSpec spec;
- spec = rsvg_css_parse_color_ (background_color_str);
+ spec = rsvg_css_parse_color (background_color_str);
if (spec.kind == RSVG_CSS_COLOR_SPEC_ARGB) {
background_color = spec.argb;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]