cocoa_foundation/
base.rs

1// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution.
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified, or distributed
8// except according to those terms.
9#![deprecated = "use the objc2 crate instead"]
10
11use objc::runtime;
12
13pub use objc::runtime::{BOOL, NO, YES};
14
15pub type Class = *mut runtime::Class;
16#[allow(non_camel_case_types)]
17pub type id = *mut runtime::Object;
18pub type SEL = runtime::Sel;
19
20#[allow(non_upper_case_globals)]
21pub const nil: id = 0 as id;
22#[allow(non_upper_case_globals)]
23pub const Nil: Class = 0 as Class;
24
25/// A convenience method to convert the name of a selector to the selector object.
26#[inline]
27pub fn selector(name: &str) -> SEL {
28    runtime::Sel::register(name)
29}