aboutsummaryrefslogtreecommitdiff
path: root/font/src
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-06-27 09:29:09 -0700
committerJoe Wilm <joe@jwilm.com>2017-06-27 09:29:09 -0700
commit63787d0bf0bcf18422b97aa7f8dea2024948c176 (patch)
tree2923904db81f6d90637120f9a3853daf701de344 /font/src
parente675044cfc7e7348afe103ea44329b22a9a4427d (diff)
downloadalacritty-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/src')
-rw-r--r--font/src/ft/list_fonts.rs41
-rw-r--r--font/src/lib.rs2
2 files changed, 36 insertions, 7 deletions
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;