648088bad4
- 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
43 lines
873 B
Rust
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;
|
|
}
|
|
|