Update for language changes

This commit is contained in:
Patrick Walton
2013-02-07 12:20:20 -08:00
parent 4ef941f09e
commit f53aaa1cdc
2 changed files with 13 additions and 3 deletions
+6 -1
View File
@@ -19,7 +19,12 @@ pub type CGDataProviderRef = *__CGDataProvider;
pub impl CGDataProviderRef : AbstractCFTypeRef {
pure fn as_type_ref(&self) -> CFTypeRef { *self as CFTypeRef }
static pure fn type_id() -> CFTypeID { unsafe { CGDataProviderGetTypeID() } }
static pure fn type_id() -> CFTypeID {
unsafe {
CGDataProviderGetTypeID()
}
}
}
pub type CGDataProvider = CFWrapper<CGDataProviderRef, (), ()>;
+7 -2
View File
@@ -11,14 +11,19 @@ pub type CGFontRef = *__CGFont;
pub impl CGFontRef : AbstractCFTypeRef {
pure fn as_type_ref(&self) -> CFTypeRef { *self as CFTypeRef }
static pure fn type_id() -> CFTypeID { unsafe { CGFontGetTypeID() } }
static pure fn type_id() -> CFTypeID {
unsafe {
CGFontGetTypeID()
}
}
}
pub type CGFont = CFWrapper<CGFontRef, (), ()>;
pub fn create_with_data_provider(provider: &CGDataProvider) -> CGFont {
// TODO: error handling
unsafe {
// TODO: error handling
let value = CGFontCreateWithDataProvider(*provider.borrow_ref());
CFWrapper::wrap_owned(value)
}