[librsvg] Handle: add a setter/getter for load_flags so it isn't public
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Handle: add a setter/getter for load_flags so it isn't public
- Date: Tue, 9 Apr 2019 16:44:14 +0000 (UTC)
commit c8a364cf7c3e9533bda16d20c50e42cbec7796a9
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Apr 4 20:04:04 2019 -0600
Handle: add a setter/getter for load_flags so it isn't public
rsvg_internals/src/c_api.rs | 8 ++++----
rsvg_internals/src/handle.rs | 10 +++++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/rsvg_internals/src/c_api.rs b/rsvg_internals/src/c_api.rs
index 5d2f1579..18a37bb3 100644
--- a/rsvg_internals/src/c_api.rs
+++ b/rsvg_internals/src/c_api.rs
@@ -286,7 +286,7 @@ impl ObjectImpl for Handle {
match *prop {
subclass::Property("flags", ..) => {
let v: HandleFlags = value.get().expect("flags value has incorrect type");
- self.load_flags.set(LoadFlags::from(v));
+ self.set_load_flags(LoadFlags::from(v));
}
subclass::Property("dpi-x", ..) => {
@@ -318,7 +318,7 @@ impl ObjectImpl for Handle {
match *prop {
subclass::Property("flags", ..) => {
- let flags = HandleFlags::from(self.load_flags.get());
+ let flags = HandleFlags::from(self.get_load_flags());
Ok(flags.to_value())
}
@@ -512,7 +512,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_get_flags(
) -> RsvgHandleFlags {
let rhandle = get_rust_handle(raw_handle);
- HandleFlags::from(rhandle.load_flags.get()).to_glib()
+ HandleFlags::from(rhandle.get_load_flags()).to_glib()
}
#[no_mangle]
@@ -523,7 +523,7 @@ pub unsafe extern "C" fn rsvg_rust_handle_set_flags(
let rhandle = get_rust_handle(raw_handle);
let flags: HandleFlags = from_glib(flags);
- rhandle.load_flags.set(LoadFlags::from(flags));
+ rhandle.set_load_flags(LoadFlags::from(flags));
}
#[no_mangle]
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index 9c6a359b..d89b1147 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -116,7 +116,7 @@ pub struct Handle {
pub base_url: RefCell<Option<Url>>,
base_url_cstring: RefCell<Option<CString>>, // needed because the C api returns *const char
svg: RefCell<Option<Rc<Svg>>>,
- pub load_flags: Cell<LoadFlags>,
+ load_flags: Cell<LoadFlags>,
load_state: Cell<LoadState>,
buffer: RefCell<Vec<u8>>, // used by the legacy write() api
size_callback: RefCell<SizeCallback>,
@@ -146,6 +146,14 @@ impl Handle {
handle
}
+ pub fn set_load_flags(&self, load_flags: LoadFlags) {
+ self.load_flags.set(load_flags);
+ }
+
+ pub fn get_load_flags(&self) -> LoadFlags {
+ self.load_flags.get()
+ }
+
// from the public API
pub fn set_base_url(&self, url: &str) {
if self.load_state.get() != LoadState::Start {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]