[librsvg: 1/7] Adjust visibility of a bunch of things in the c_api crate
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 1/7] Adjust visibility of a bunch of things in the c_api crate
- Date: Thu, 29 Oct 2020 00:48:33 +0000 (UTC)
commit c0f409c80a17a0f3fae0e65e676aff947684d42c
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Oct 28 17:24:29 2020 -0600
Adjust visibility of a bunch of things in the c_api crate
librsvg/c_api.rs | 42 +++++++++++++++++++++---------------------
librsvg/color_utils.rs | 2 +-
librsvg/dpi.rs | 8 ++++----
librsvg/lib.rs | 2 +-
librsvg/messages.rs | 4 ++--
5 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/librsvg/c_api.rs b/librsvg/c_api.rs
index 84de9796..f9227858 100644
--- a/librsvg/c_api.rs
+++ b/librsvg/c_api.rs
@@ -126,11 +126,11 @@ mod handle_flags {
#[derive(Default, Copy, Clone)]
struct LoadFlags {
- pub unlimited_size: bool,
- pub keep_image_data: bool,
+ unlimited_size: bool,
+ keep_image_data: bool,
}
-pub use self::handle_flags::*;
+use self::handle_flags::*;
impl From<HandleFlags> for LoadFlags {
fn from(hflags: HandleFlags) -> LoadFlags {
@@ -514,7 +514,7 @@ impl ObjectImpl for CHandle {
}
// Keep in sync with tests/src/reference.rs
-pub fn checked_i32(x: f64) -> Result<i32, cairo::Status> {
+pub(crate) fn checked_i32(x: f64) -> Result<i32, cairo::Status> {
cast::i32(x).map_err(|_| cairo::Status::InvalidSize)
}
@@ -557,15 +557,15 @@ pub type RsvgSizeFunc = Option<
),
;
-pub struct SizeCallback {
- pub size_func: RsvgSizeFunc,
- pub user_data: glib_sys::gpointer,
- pub destroy_notify: glib_sys::GDestroyNotify,
- pub in_loop: Cell<bool>,
+struct SizeCallback {
+ size_func: RsvgSizeFunc,
+ user_data: glib_sys::gpointer,
+ destroy_notify: glib_sys::GDestroyNotify,
+ in_loop: Cell<bool>,
}
impl SizeCallback {
- pub fn new(
+ fn new(
size_func: RsvgSizeFunc,
user_data: glib_sys::gpointer,
destroy_notify: glib_sys::GDestroyNotify,
@@ -578,7 +578,7 @@ impl SizeCallback {
}
}
- pub fn call(&self, width: libc::c_int, height: libc::c_int) -> (libc::c_int, libc::c_int) {
+ fn call(&self, width: libc::c_int, height: libc::c_int) -> (libc::c_int, libc::c_int) {
unsafe {
let mut w = width;
let mut h = height;
@@ -591,17 +591,17 @@ impl SizeCallback {
}
}
- pub fn start_loop(&self) {
+ fn start_loop(&self) {
assert!(!self.in_loop.get());
self.in_loop.set(true);
}
- pub fn end_loop(&self) {
+ fn end_loop(&self) {
assert!(self.in_loop.get());
self.in_loop.set(false);
}
- pub fn get_in_loop(&self) -> bool {
+ fn get_in_loop(&self) -> bool {
self.in_loop.get()
}
}
@@ -643,7 +643,7 @@ impl CairoRectangleExt for cairo::Rectangle {
}
impl CHandle {
- pub fn set_base_url(&self, url: &str) {
+ fn set_base_url(&self, url: &str) {
let state = self.load_state.borrow();
match *state {
@@ -773,7 +773,7 @@ impl CHandle {
}
}
- pub fn read_stream_sync(
+ fn read_stream_sync(
&self,
stream: &gio::InputStream,
cancellable: Option<&gio::Cancellable>,
@@ -944,7 +944,7 @@ impl CHandle {
renderer
}
- pub fn get_geometry_sub(
+ fn get_geometry_sub(
&self,
id: Option<&str>,
) -> Result<(cairo::Rectangle, cairo::Rectangle), RenderingError> {
@@ -1021,7 +1021,7 @@ impl CHandle {
pixbuf_from_surface(&surface)
}
- pub fn render_document(
+ fn render_document(
&self,
cr: &cairo::Context,
viewport: &cairo::Rectangle,
@@ -1114,7 +1114,7 @@ impl CHandle {
}
}
-pub fn unit_rectangle() -> cairo::Rectangle {
+pub(crate) fn unit_rectangle() -> cairo::Rectangle {
cairo::Rectangle::from_size(1.0, 1.0)
}
@@ -2201,10 +2201,10 @@ pub(crate) fn set_gerror(err: *mut *mut glib_sys::GError, code: u32, msg: &str)
/// the public librsvg API does not have detailed error codes yet, so we use
/// this single value as the only possible error code to return.
#[derive(Copy, Clone)]
-pub struct RsvgError;
+struct RsvgError;
// Keep in sync with rsvg.h:RsvgError
-pub const RSVG_ERROR_FAILED: i32 = 0;
+const RSVG_ERROR_FAILED: i32 = 0;
impl ErrorDomain for RsvgError {
fn domain() -> glib::Quark {
diff --git a/librsvg/color_utils.rs b/librsvg/color_utils.rs
index 046e4996..7f2c4279 100644
--- a/librsvg/color_utils.rs
+++ b/librsvg/color_utils.rs
@@ -18,7 +18,7 @@ use rsvg_internals::{Color, Parse};
// Keep this in sync with rsvg-css.h:RsvgCssColorKind
#[repr(C)]
#[derive(Clone, Copy, PartialEq, Debug)]
-pub enum ColorKind {
+enum ColorKind {
ARGB,
ParseError,
}
diff --git a/librsvg/dpi.rs b/librsvg/dpi.rs
index f8e07edc..c27667d8 100644
--- a/librsvg/dpi.rs
+++ b/librsvg/dpi.rs
@@ -18,17 +18,17 @@ static mut DPI_X: f64 = DEFAULT_DPI_X;
static mut DPI_Y: f64 = DEFAULT_DPI_Y;
#[derive(Debug, Copy, Clone, Default)]
-pub struct Dpi {
+pub(crate) struct Dpi {
x: f64,
y: f64,
}
impl Dpi {
- pub fn new(x: f64, y: f64) -> Dpi {
+ pub(crate) fn new(x: f64, y: f64) -> Dpi {
Dpi { x, y }
}
- pub fn x(&self) -> f64 {
+ pub(crate) fn x(&self) -> f64 {
if self.x <= 0.0 {
unsafe { DPI_X }
} else {
@@ -36,7 +36,7 @@ impl Dpi {
}
}
- pub fn y(&self) -> f64 {
+ pub(crate) fn y(&self) -> f64 {
if self.y <= 0.0 {
unsafe { DPI_Y }
} else {
diff --git a/librsvg/lib.rs b/librsvg/lib.rs
index 136a4e0c..b56de28b 100644
--- a/librsvg/lib.rs
+++ b/librsvg/lib.rs
@@ -53,5 +53,5 @@ mod messages;
mod c_api;
mod color_utils;
mod dpi;
-pub mod pixbuf_utils;
+mod pixbuf_utils;
mod sizing;
diff --git a/librsvg/messages.rs b/librsvg/messages.rs
index 958ce1d0..9157184d 100644
--- a/librsvg/messages.rs
+++ b/librsvg/messages.rs
@@ -70,11 +70,11 @@ fn rsvg_g_log(level: glib_sys::GLogLevelFlags, msg: &str) {
}
}
-pub fn rsvg_g_warning(msg: &str) {
+pub(crate) fn rsvg_g_warning(msg: &str) {
rsvg_g_log(glib_sys::G_LOG_LEVEL_WARNING, msg);
}
-pub fn rsvg_g_critical(msg: &str) {
+pub(crate) fn rsvg_g_critical(msg: &str) {
rsvg_g_log(glib_sys::G_LOG_LEVEL_CRITICAL, msg);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]