[librsvg/librsvg-2.48] Move RsvgDimensionData to c_api
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.48] Move RsvgDimensionData to c_api
- Date: Tue, 5 May 2020 19:47:17 +0000 (UTC)
commit 603a371bfa2e08b529aa39c331330524a59d7253
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Apr 30 20:20:05 2020 -0500
Move RsvgDimensionData to c_api
It's not used in rsvg_internals anymore.
librsvg/c_api.rs | 27 +++++++++++++++++++++++++--
rsvg_internals/src/handle.rs | 23 -----------------------
rsvg_internals/src/lib.rs | 4 +---
3 files changed, 26 insertions(+), 28 deletions(-)
---
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index 25ca9037..cfc53e3c 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -35,8 +35,8 @@ use gobject_sys::{GEnumValue, GFlagsValue};
use rsvg_internals::{
rsvg_log, DefsLookupErrorKind, Dpi, Handle, IntrinsicDimensions, LoadOptions, LoadingError,
- RenderingError, RsvgDimensionData, RsvgLength, RsvgPositionData, RsvgSizeFunc,
- SharedImageSurface, SizeCallback, SurfaceType, ViewBox,
+ RenderingError, RsvgLength, RsvgPositionData, RsvgSizeFunc, SharedImageSurface, SizeCallback,
+ SurfaceType, ViewBox,
};
use crate::messages::{rsvg_g_critical, rsvg_g_warning};
@@ -469,6 +469,29 @@ pub fn checked_i32(x: f64) -> Result<i32, cairo::Status> {
cast::i32(x).map_err(|_| cairo::Status::InvalidSize)
}
+// Keep in sync with rsvg.h:RsvgDimensionData
+#[repr(C)]
+pub struct RsvgDimensionData {
+ pub width: libc::c_int,
+ pub height: libc::c_int,
+ pub em: f64,
+ pub ex: f64,
+}
+
+impl RsvgDimensionData {
+ // This is not #[derive(Default)] to make it clear that it
+ // shouldn't be the default value for anything; it is actually a
+ // special case we use to indicate an error to the public API.
+ pub fn empty() -> RsvgDimensionData {
+ RsvgDimensionData {
+ width: 0,
+ height: 0,
+ em: 0.0,
+ ex: 0.0,
+ }
+ }
+}
+
impl CHandle {
fn set_base_url(&self, url: &str) {
let state = self.load_state.borrow();
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 1e9dfbaf..87f32cf8 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -83,29 +83,6 @@ impl LoadOptions {
}
}
-// Keep in sync with rsvg.h:RsvgDimensionData
-#[repr(C)]
-pub struct RsvgDimensionData {
- pub width: libc::c_int,
- pub height: libc::c_int,
- pub em: f64,
- pub ex: f64,
-}
-
-impl RsvgDimensionData {
- // This is not #[derive(Default)] to make it clear that it
- // shouldn't be the default value for anything; it is actually a
- // special case we use to indicate an error to the public API.
- pub fn empty() -> RsvgDimensionData {
- RsvgDimensionData {
- width: 0,
- height: 0,
- em: 0.0,
- ex: 0.0,
- }
- }
-}
-
// Keep in sync with rsvg.h:RsvgPositionData
#[repr(C)]
pub struct RsvgPositionData {
diff --git a/rsvg_internals/src/lib.rs b/rsvg_internals/src/lib.rs
index 50a55007..21a26860 100644
--- a/rsvg_internals/src/lib.rs
+++ b/rsvg_internals/src/lib.rs
@@ -45,9 +45,7 @@ pub use crate::dpi::{rsvg_rust_set_default_dpi_x_y, Dpi};
pub use crate::error::{DefsLookupErrorKind, HrefError, LoadingError, RenderingError};
-pub use crate::handle::{
- Handle, LoadOptions, RsvgDimensionData, RsvgPositionData, RsvgSizeFunc, SizeCallback,
-};
+pub use crate::handle::{Handle, LoadOptions, RsvgPositionData, RsvgSizeFunc, SizeCallback};
pub use crate::length::{Length, LengthUnit, RsvgLength};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]