diff --git a/azure.rc b/azure.rc index c0d4285..70e9150 100644 --- a/azure.rc +++ b/azure.rc @@ -7,17 +7,17 @@ #[feature(globs)]; -extern mod std; -extern mod extra; -extern mod geom; -extern mod layers; -extern mod opengles; +extern crate std; +extern crate sync; +extern crate geom; +extern crate layers; +extern crate opengles; #[cfg(target_os = "linux")] -extern mod xlib; +extern crate xlib; #[cfg(target_os = "android")] -extern mod egl; +extern crate egl; #[cfg(not(target_os = "android"))] -extern mod glfw; +extern crate glfw = "glfw-rs"; pub use azure::*; diff --git a/azure.rs b/azure.rs index 8e9a5aa..50177f7 100644 --- a/azure.rs +++ b/azure.rs @@ -4,7 +4,7 @@ /* automatically generated by rust-bindgen */ -#[allow(non_uppercase_statics)]; +#[allow(non_uppercase_statics, non_camel_case_types)]; use std::libc::*; diff --git a/azure_hl.rs b/azure_hl.rs index 881bb32..0bc869a 100644 --- a/azure_hl.rs +++ b/azure_hl.rs @@ -30,7 +30,7 @@ use azure::{AzSkiaSharedGLContextFlush, AzSkiaGrGLSharedSurfaceRef}; use azure::{AzCreatePathBuilder, AzPathBuilderRef, AzPathBuilderMoveTo, AzPathBuilderLineTo, AzPathBuilderFinish, AzReleasePathBuilder}; use azure::{AzDrawTargetFill, AzPathRef, AzReleasePath, AzDrawTargetPushClip, AzDrawTargetPopClip}; -use extra::arc::Arc; +use sync::Arc; use geom::matrix2d::Matrix2D; use geom::point::Point2D; use geom::rect::Rect; @@ -40,7 +40,7 @@ use std::libc::types::common::c99::{uint8_t, uint16_t}; use std::libc::size_t; use std::cast; use std::ptr; -use std::ptr::{null, to_unsafe_ptr}; +use std::ptr::null; use std::vec; #[cfg(target_os="linux")] @@ -452,7 +452,7 @@ impl DrawTarget { pub fn fill_rect(&self, rect: &Rect, pattern: &ColorPattern) { unsafe { AzDrawTargetFillRect(self.azure_draw_target, - to_unsafe_ptr(&rect.as_azure_rect()), + &rect.as_azure_rect(), pattern.azure_color_pattern); } } @@ -496,10 +496,10 @@ impl DrawTarget { unsafe { AzDrawTargetDrawSurface(self.azure_draw_target, surface.azure_source_surface, - to_unsafe_ptr(&dest.as_azure_rect()), - to_unsafe_ptr(&source.as_azure_rect()), - to_unsafe_ptr(&surf_options.as_azure_draw_surface_options()), - to_unsafe_ptr(&options.as_azure_draw_options())); + &dest.as_azure_rect(), + &source.as_azure_rect(), + &surf_options.as_azure_draw_surface_options(), + &options.as_azure_draw_options()); } } @@ -541,9 +541,9 @@ impl DrawTarget { unsafe { AzDrawTargetFillGlyphs(self.azure_draw_target, azfontref, - to_unsafe_ptr(&glyphbuf), + &glyphbuf, azure_pattern, - to_unsafe_ptr(&options), + &options, renderingOptions); } } diff --git a/linkhack.rs b/linkhack.rs index 1a9fbaf..0d7f7cf 100644 --- a/linkhack.rs +++ b/linkhack.rs @@ -8,6 +8,8 @@ #[link(name = "azure")] #[link(name = "stdc++")] #[link(name = "skia")] +// skia must come before freetype for linking to succeed +#[link(name = "freetype")] // fontconfig must come before expat for linking to succeed #[link(name = "fontconfig")] #[link(name = "expat")] diff --git a/scaled_font.rs b/scaled_font.rs index 78386a0..6f6617b 100644 --- a/scaled_font.rs +++ b/scaled_font.rs @@ -23,9 +23,9 @@ use scaled_font::android::*; #[cfg(target_os="macos")] pub mod macos { - extern mod core_foundation; - extern mod core_graphics; - extern mod core_text; + extern crate core_foundation; + extern crate core_graphics; + extern crate core_text; pub use scaled_font::macos::core_text::font::CTFontRef; pub use scaled_font::macos::core_graphics::font::{CGFont, CGFontRef}; @@ -33,14 +33,14 @@ pub mod macos { #[cfg(target_os="linux")] pub mod linux { - extern mod freetype; + extern crate freetype; pub use scaled_font::linux::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } #[cfg(target_os="android")] pub mod android { - extern mod freetype; + extern crate freetype; pub use scaled_font::android::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } @@ -84,7 +84,7 @@ impl ScaledFont { let options = AzCreateFontOptions((*native_font).family_name, style); azure_native_font.mType = AZ_NATIVE_FONT_SKIA_FONT_FACE; azure_native_font.mFont = cast::transmute(options); - let azure_native_font_ptr = ptr::to_unsafe_ptr(&azure_native_font); + let azure_native_font_ptr = &azure_native_font; let azure_scaled_font = AzCreateScaledFontForNativeFont(azure_native_font_ptr, size); AzDestroyFontOptions(options); ScaledFont { azure_scaled_font: azure_scaled_font }