[librsvg: 2/5] Use cairo::Context::tag_begin(); require Cairo 1.16.0
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 2/5] Use cairo::Context::tag_begin(); require Cairo 1.16.0
- Date: Thu, 7 Mar 2019 23:15:19 +0000 (UTC)
commit 3c0de55f34f8c7dd876b34560897e8d9bbe9fb7a
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Mar 7 16:52:23 2019 -0600
Use cairo::Context::tag_begin(); require Cairo 1.16.0
The tag_begin/tag_end functions are now available in cairo-rs with the
v1_16 feature.
COMPILING.md | 2 +-
NEWS | 2 ++
configure.ac | 2 +-
rsvg_internals/Cargo.toml | 2 +-
rsvg_internals/src/link.rs | 41 -----------------------------------------
5 files changed, 5 insertions(+), 44 deletions(-)
---
diff --git a/COMPILING.md b/COMPILING.md
index 2f06050b..a70f1223 100644
--- a/COMPILING.md
+++ b/COMPILING.md
@@ -37,7 +37,7 @@ minimum version is listed here; you may use a newer version instead.
**Mandatory dependencies:**
-* Cairo 1.15.12 with PNG support
+* Cairo 1.16.0 with PNG support
* Freetype2 2.8.0
* Libcroco 0.6.1
* Gdk-pixbuf 2.20.0
diff --git a/NEWS b/NEWS
index f1df9066..f4ab03e4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
Version 2.45.6
- Librsvg now requires Rust 1.30.0 or later.
+- Librsvg now requires Cairo 1.16.0 or later. Thanks to
+ Julian Sparber for keeping up with cairo-rs API changes.
Version 2.45.5
- At build time, you can now pass $CARGO and $RUSTC environment
diff --git a/configure.ac b/configure.ac
index ed92d532..8be9e7b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Define to the gettext
dnl ===========================================================================
dnl Please update COMPILING.md with version numbers if these change
-CAIRO_REQUIRED=1.15.12
+CAIRO_REQUIRED=1.16.0
CROCO_REQUIRED=0.6.1
dnl This corresponds to Freetype2 2.8
FREETYPE2_REQUIRED=20.0.14
diff --git a/rsvg_internals/Cargo.toml b/rsvg_internals/Cargo.toml
index f2b53ba9..77182c39 100644
--- a/rsvg_internals/Cargo.toml
+++ b/rsvg_internals/Cargo.toml
@@ -21,7 +21,7 @@ phf_codegen = "0.7.21"
[dependencies]
bitflags = "1.0"
-cairo-rs = "0.6.0"
+cairo-rs = { version="0.6.0", features=["v1_16"] }
cairo-sys-rs = "0.8.0"
cssparser = "0.25.1"
data-url = "0.1"
diff --git a/rsvg_internals/src/link.rs b/rsvg_internals/src/link.rs
index 6018466f..5ea779a5 100644
--- a/rsvg_internals/src/link.rs
+++ b/rsvg_internals/src/link.rs
@@ -1,8 +1,3 @@
-use cairo;
-use cairo_sys;
-use glib::translate::*;
-use libc;
-
use regex::{Captures, Regex};
use std::borrow::Cow;
use std::cell::RefCell;
@@ -85,39 +80,3 @@ fn escape_value(value: &str) -> Cow<'_, str> {
}
})
}
-
-#[cfg(not(feature = "v1_16"))]
-extern "C" {
- fn cairo_tag_begin(
- cr: *mut cairo_sys::cairo_t,
- tag_name: *const libc::c_char,
- attibutes: *const libc::c_char,
- );
- fn cairo_tag_end(cr: *mut cairo_sys::cairo_t, tag_name: *const libc::c_char);
-}
-
-/// Bindings that aren't supported by `cairo-rs` for now
-#[cfg(not(feature = "v1_16"))]
-trait CairoTagging {
- fn tag_begin(&self, tag_name: &str, attributes: &str);
- fn tag_end(&self, tag_name: &str);
-}
-
-#[cfg(not(feature = "v1_16"))]
-impl CairoTagging for cairo::Context {
- fn tag_begin(&self, tag_name: &str, attributes: &str) {
- unsafe {
- cairo_tag_begin(
- self.to_glib_none().0,
- tag_name.to_glib_none().0,
- attributes.to_glib_none().0,
- );
- }
- }
-
- fn tag_end(&self, tag_name: &str) {
- unsafe {
- cairo_tag_end(self.to_glib_none().0, tag_name.to_glib_none().0);
- }
- }
-}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]