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/src/ft | |
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/src/ft')
-rw-r--r-- | font/src/ft/list_fonts.rs | 41 |
1 files changed, 35 insertions, 6 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)] |