Files
core-foundation-rs/boolean.rs
T
Jack Moffitt 648088bad4 Upgraded to Rust 0.6 syntax.
- removed pub from `pub impl A for B`
- replaced `const` with `static`
- implemented `Drop` and `Index` traits
- removed `pure` and `static` function keywords
- removed `DVec`
- added `self` parameters to methods
2013-03-26 16:17:39 -06:00

43 lines
873 B
Rust

use base::{
AbstractCFTypeRef,
CFTypeRef,
CFTypeID,
CFWrapper,
};
pub type Boolean = u32;
struct __CFBoolean { private: () }
pub type CFBooleanRef = *__CFBoolean;
impl AbstractCFTypeRef for CFBooleanRef {
fn as_type_ref(&self) -> CFTypeRef { *self as CFTypeRef }
fn type_id() -> CFTypeID {
unsafe { CFBooleanGetTypeID() }
}
}
pub type CFBoolean = CFWrapper<CFBooleanRef, (), ()>;
pub impl CFBoolean {
fn true_value() -> CFBoolean {
CFWrapper::wrap_shared(kCFBooleanTrue)
}
fn false_value() -> CFBoolean {
CFWrapper::wrap_shared(kCFBooleanFalse)
}
}
#[link_args="-framework CoreFoundation"]
#[nolink]
extern {
static kCFBooleanTrue: CFBooleanRef;
static kCFBooleanFalse: CFBooleanRef;
fn CFBooleanGetValue(boolean: CFBooleanRef) -> Boolean;
fn CFBooleanGetTypeID() -> CFTypeID;
}