diff options
author | Joe Wilm <joe@jwilm.com> | 2017-06-27 09:29:09 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-06-27 09:29:09 -0700 |
commit | 63787d0bf0bcf18422b97aa7f8dea2024948c176 (patch) | |
tree | 2923904db81f6d90637120f9a3853daf701de344 /font | |
parent | e675044cfc7e7348afe103ea44329b22a9a4427d (diff) | |
download | alacritty-63787d0bf0bcf18422b97aa7f8dea2024948c176.tar.gz alacritty-63787d0bf0bcf18422b97aa7f8dea2024948c176.zip |
Use foreign-types from crates.io
We had previously vendored a very early version of this package before
it was ever published.
Diffstat (limited to 'font')
-rw-r--r-- | font/Cargo.lock | 26 | ||||
-rw-r--r-- | font/Cargo.toml | 2 | ||||
-rw-r--r-- | font/src/ft/list_fonts.rs | 41 | ||||
-rw-r--r-- | font/src/lib.rs | 2 |
4 files changed, 51 insertions, 20 deletions
diff --git a/font/Cargo.lock b/font/Cargo.lock index 68d6bb87..28434a2e 100644 --- a/font/Cargo.lock +++ b/font/Cargo.lock @@ -4,10 +4,10 @@ version = "0.1.0" dependencies = [ "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-text 4.0.0 (git+https://github.com/servo/core-text-rs?rev=7a267bc8f6c098f5370583333a5fd00a0d12fb83)", + "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ffi-util 0.1.0", + "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "freetype-rs 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -38,21 +38,21 @@ dependencies = [ [[package]] name = "core-graphics" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-text" -version = "4.0.0" -source = "git+https://github.com/servo/core-text-rs?rev=7a267bc8f6c098f5370583333a5fd00a0d12fb83#7a267bc8f6c098f5370583333a5fd00a0d12fb83" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -78,8 +78,9 @@ dependencies = [ ] [[package]] -name = "ffi-util" -version = "0.1.0" +name = "foreign-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "freetype-rs" @@ -201,10 +202,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" "checksum core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f51ce3b8ebe311c56de14231eb57572c15abebd2d32b3bcb99bcdb9c101f5ac3" "checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624" -"checksum core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ead017dcf77f503dc991f6b52de6084eeea60a94b0a652baa9bf88654a28e83f" -"checksum core-text 4.0.0 (git+https://github.com/servo/core-text-rs?rev=7a267bc8f6c098f5370583333a5fd00a0d12fb83)" = "<none>" +"checksum core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a9f841e9637adec70838c537cae52cb4c751cc6514ad05669b51d107c2021c79" +"checksum core-text 5.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c42ae17408d6b881992268f638257e67303fc7c6c88723dbc0fe5889b22c0bc" "checksum euclid 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba6ab6f0e63a602978f4b8cf8a43f87a1a475ddf32407f087d579a13cf06b114" "checksum expat-sys 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccf6f838594c1571f176f0afdbeb9cfa9f83b478f269d3f0390939b1df4323e" +"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" "checksum freetype-rs 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1418e2a055fec8efe18c1a90a54b2cf5e649e583830dd4c71226c4e3bc920c6" "checksum freetype-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccfb6d96cac99921f0c2142a91765f6c219868a2c45bdfe7d65a08775f18127" "checksum gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)" = "3da3a2cbaeb01363c8e3704fd9fd0eb2ceb17c6f27abd4c1ef040fb57d20dc79" diff --git a/font/Cargo.toml b/font/Cargo.toml index 17ba78ed..98c7eaad 100644 --- a/font/Cargo.toml +++ b/font/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" [dependencies] euclid = "0.12.0" libc = "0.2" -ffi-util = { path = "../ffi-util" } +foreign-types = "0.2.0" log = "0.3" [target.'cfg(not(target_os = "macos"))'.dependencies] diff --git a/font/src/ft/list_fonts.rs b/font/src/ft/list_fonts.rs index 5fa40ac8..7fdf6250 100644 --- a/font/src/ft/list_fonts.rs +++ b/font/src/ft/list_fonts.rs @@ -19,7 +19,7 @@ pub mod fc { use std::ops::Deref; use std::path::PathBuf; - use ffi_util::{ForeignType, ForeignTypeRef}; + use foreign_types::{ForeignType, ForeignTypeRef}; use libc::{c_char, c_int}; use fontconfig::fontconfig as ffi; @@ -47,11 +47,40 @@ pub mod fc { current: usize, } - ffi_type!(Pattern, PatternRef, FcPattern, FcPatternDestroy); - ffi_type!(Config, ConfigRef, FcConfig, FcConfigDestroy); - ffi_type!(ObjectSet, ObjectSetRef, FcObjectSet, FcObjectSetDestroy); - ffi_type!(FontSet, FontSetRef, FcFontSet, FcFontSetDestroy); - ffi_type!(CharSet, CharSetRef, FcCharSet, FcCharSetDestroy); + foreign_type! { + type CType = FcPattern; + fn drop = FcPatternDestroy; + pub struct Pattern; + pub struct PatternRef; + } + + foreign_type! { + type CType = FcConfig; + fn drop = FcConfigDestroy; + pub struct Config; + pub struct ConfigRef; + } + + foreign_type! { + type CType = FcObjectSet; + fn drop = FcObjectSetDestroy; + pub struct ObjectSet; + pub struct ObjectSetRef; + } + + foreign_type! { + type CType = FcFontSet; + fn drop = FcFontSetDestroy; + pub struct FontSet; + pub struct FontSetRef; + } + + foreign_type! { + type CType = FcCharSet; + fn drop = FcCharSetDestroy; + pub struct CharSet; + pub struct CharSetRef; + } impl ObjectSet { #[allow(dead_code)] diff --git a/font/src/lib.rs b/font/src/lib.rs index f04f00d8..4d63c7f3 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -36,7 +36,7 @@ extern crate libc; #[cfg(not(target_os = "macos"))] #[macro_use] -extern crate ffi_util; +extern crate foreign_types; #[macro_use] extern crate log; |