use std::ptr::null;
use objc::{sel, class, msg_send, sel_impl};
#[allow(non_camel_case_types)]
pub type id = *mut objc::runtime::Object;
pub type instancetype = id;
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct CWWiFiClient(pub id);
impl std::ops::Deref for CWWiFiClient {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for CWWiFiClient {}
impl CWWiFiClient {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(CWWiFiClient), alloc) })
}
}
impl ICWWiFiClient for CWWiFiClient {}
pub trait ICWWiFiClient: Sized + std::ops::Deref {
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn interface(&self) -> CWInterface
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, interface)
}
unsafe fn interfaceWithName_(&self, interfaceName: NSString) -> CWInterface
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, interfaceWithName: interfaceName)
}
unsafe fn interfaces(&self) -> NSArray
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, interfaces)
}
unsafe fn startMonitoringEventWithType_error_(
&self,
type_: CWEventType,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , startMonitoringEventWithType : type_ error : error)
}
unsafe fn stopMonitoringEventWithType_error_(
&self,
type_: CWEventType,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , stopMonitoringEventWithType : type_ error : error)
}
unsafe fn stopMonitoringAllEventsAndReturnError_(&self, error: *mut NSError) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, stopMonitoringAllEventsAndReturnError: error)
}
unsafe fn delegate(&self) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, delegate)
}
unsafe fn setDelegate_(&self, delegate: id)
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, setDelegate: delegate)
}
unsafe fn sharedWiFiClient() -> CWWiFiClient
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWWiFiClient), sharedWiFiClient)
}
unsafe fn interfaceNames() -> NSArray
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWWiFiClient), interfaceNames)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct CWInterface(pub id);
impl std::ops::Deref for CWInterface {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for CWInterface {}
impl CWInterface {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(CWInterface), alloc) })
}
}
impl ICWInterface for CWInterface {}
pub trait ICWInterface: Sized + std::ops::Deref {
unsafe fn powerOn(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, powerOn)
}
unsafe fn supportedWLANChannels(&self) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, supportedWLANChannels)
}
unsafe fn wlanChannel(&self) -> CWChannel
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, wlanChannel)
}
unsafe fn activePHYMode(&self) -> CWPHYMode
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, activePHYMode)
}
unsafe fn ssid(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, ssid)
}
unsafe fn ssidData(&self) -> NSData
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, ssidData)
}
unsafe fn bssid(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, bssid)
}
unsafe fn rssiValue(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, rssiValue)
}
unsafe fn noiseMeasurement(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, noiseMeasurement)
}
unsafe fn security(&self) -> CWSecurity
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, security)
}
unsafe fn transmitRate(&self) -> f64
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, transmitRate)
}
unsafe fn countryCode(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, countryCode)
}
unsafe fn interfaceMode(&self) -> CWInterfaceMode
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, interfaceMode)
}
unsafe fn transmitPower(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, transmitPower)
}
unsafe fn hardwareAddress(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, hardwareAddress)
}
unsafe fn serviceActive(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, serviceActive)
}
unsafe fn cachedScanResults(&self) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, cachedScanResults)
}
unsafe fn configuration(&self) -> CWConfiguration
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, configuration)
}
unsafe fn initWithInterfaceName_(&self, name: NSString) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithInterfaceName: name)
}
unsafe fn setPower_error_(&self, power: bool, error: *mut NSError) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , setPower : power error : error)
}
unsafe fn setWLANChannel_error_(&self, channel: CWChannel, error: *mut NSError) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , setWLANChannel : channel error : error)
}
unsafe fn setPairwiseMasterKey_error_(&self, key: NSData, error: *mut NSError) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , setPairwiseMasterKey : key error : error)
}
unsafe fn setWEPKey_flags_index_error_(
&self,
key: NSData,
flags: CWCipherKeyFlags,
index: NSInteger,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , setWEPKey : key flags : flags index : index error : error)
}
unsafe fn scanForNetworksWithSSID_error_(&self, ssid: NSData, error: *mut NSError) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , scanForNetworksWithSSID : ssid error : error)
}
unsafe fn scanForNetworksWithSSID_includeHidden_error_(
&self,
ssid: NSData,
includeHidden: bool,
error: *mut NSError,
) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , scanForNetworksWithSSID : ssid includeHidden : includeHidden error : error)
}
unsafe fn scanForNetworksWithName_error_(
&self,
networkName: NSString,
error: *mut NSError,
) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , scanForNetworksWithName : networkName error : error)
}
unsafe fn scanForNetworks_error_(
&self,
error: *mut NSError,
) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , scanForNetworksWithName : null::<NSString>() error : error)
}
unsafe fn scanForNetworksWithName_includeHidden_error_(
&self,
networkName: NSString,
includeHidden: bool,
error: *mut NSError,
) -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , scanForNetworksWithName : networkName includeHidden : includeHidden error : error)
}
unsafe fn associateToNetwork_password_error_(
&self,
network: CWNetwork,
password: NSString,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , associateToNetwork : network password : password error : error)
}
unsafe fn disassociate(&self)
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, disassociate)
}
unsafe fn associateToEnterpriseNetwork_identity_username_password_error_(
&self,
network: CWNetwork,
identity: SecIdentityRef,
username: NSString,
password: NSString,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , associateToEnterpriseNetwork : network identity : identity username : username password : password error : error)
}
unsafe fn startIBSSModeWithSSID_security_channel_password_error_(
&self,
ssidData: NSData,
security: CWIBSSModeSecurity,
channel: NSUInteger,
password: NSString,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , startIBSSModeWithSSID : ssidData security : security channel : channel password : password error : error)
}
unsafe fn commitConfiguration_authorization_error_(
&self,
configuration: CWConfiguration,
authorization: SFAuthorization,
error: *mut NSError,
) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , commitConfiguration : configuration authorization : authorization error : error)
}
unsafe fn interfaceName(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, interfaceName)
}
unsafe fn interfaceNames() -> NSSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWInterface), interfaceNames)
}
unsafe fn interface() -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWInterface), interface)
}
unsafe fn interfaceWithName_(name: NSString) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWInterface), interfaceWithName: name)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSString(pub id);
impl std::ops::Deref for NSString {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSString {}
impl NSString {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSString), alloc) })
}
}
pub type NSInteger = std::os::raw::c_long;
pub type NSUInteger = std::os::raw::c_ulong;
pub type Unichar = std::os::raw::c_ushort;
impl INSString for NSString {}
pub trait INSString: Sized + std::ops::Deref {
unsafe fn characterAtIndex_(&self, index: NSUInteger) -> Unichar
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, characterAtIndex: index)
}
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithCoder_(&self, coder: NSCoder) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithCoder: coder)
}
unsafe fn length(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, length)
}
unsafe fn stringWithUTF8String(string: *const [u8]) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(NSString), stringWithUTF8String: string)
}
unsafe fn UTF8String(&self) -> *const std::ffi::c_char
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, UTF8String)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSCoder(pub id);
impl std::ops::Deref for NSCoder {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSCoder {}
impl NSCoder {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSCoder), alloc) })
}
}
impl INSCoder for NSCoder {}
pub trait INSCoder: Sized + std::ops::Deref {
unsafe fn encodeValueOfObjCType_at_(
&self,
type_: *const ::std::os::raw::c_char,
addr: *const ::std::os::raw::c_void,
) where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , encodeValueOfObjCType : type_ at : addr)
}
unsafe fn encodeDataObject_(&self, data: NSData)
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, encodeDataObject: data)
}
unsafe fn decodeDataObject(&self) -> NSData
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, decodeDataObject)
}
unsafe fn decodeValueOfObjCType_at_size_(
&self,
type_: *const ::std::os::raw::c_char,
data: *mut ::std::os::raw::c_void,
size: NSUInteger,
) where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , decodeValueOfObjCType : type_ at : data size : size)
}
unsafe fn versionForClassName_(&self, className: NSString) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, versionForClassName: className)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSData(pub id);
impl std::ops::Deref for NSData {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSData {}
impl NSData {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSData), alloc) })
}
}
impl INSData for NSData {}
pub trait INSData: Sized + std::ops::Deref {
unsafe fn length(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, length)
}
unsafe fn bytes(&self) -> *const ::std::os::raw::c_void
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, bytes)
}
}
pub const CWEventType_CWEventTypeNone: CWEventType = 0;
pub const CWEventType_CWEventTypePowerDidChange: CWEventType = 1;
pub const CWEventType_CWEventTypeSSIDDidChange: CWEventType = 2;
pub const CWEventType_CWEventTypeBSSIDDidChange: CWEventType = 3;
pub const CWEventType_CWEventTypeCountryCodeDidChange: CWEventType = 4;
pub const CWEventType_CWEventTypeLinkDidChange: CWEventType = 5;
pub const CWEventType_CWEventTypeLinkQualityDidChange: CWEventType = 6;
pub const CWEventType_CWEventTypeModeDidChange: CWEventType = 7;
pub const CWEventType_CWEventTypeScanCacheUpdated: CWEventType = 8;
pub const CWEventType_CWEventTypeUnknown: CWEventType = 9223372036854775807;
pub type CWEventType = NSInteger;
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSError(pub id);
impl std::ops::Deref for NSError {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSError {}
impl NSError {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSError), alloc) })
}
}
impl INSError for NSError {}
pub trait INSError: Sized + std::ops::Deref {
unsafe fn initWithDomain_code_userInfo_(
&self,
domain: NSString,
code: NSInteger,
dict: NSDictionary,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , initWithDomain : domain code : code userInfo : dict)
}
unsafe fn domain(&self) -> NSErrorDomain
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, domain)
}
unsafe fn code(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, code)
}
unsafe fn userInfo(&self) -> NSDictionary
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, userInfo)
}
unsafe fn localizedDescription(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, localizedDescription)
}
unsafe fn localizedFailureReason(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, localizedFailureReason)
}
unsafe fn localizedRecoverySuggestion(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, localizedRecoverySuggestion)
}
unsafe fn localizedRecoveryOptions(&self) -> NSArray
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, localizedRecoveryOptions)
}
unsafe fn recoveryAttempter(&self) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, recoveryAttempter)
}
unsafe fn helpAnchor(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, helpAnchor)
}
unsafe fn underlyingErrors(&self) -> NSArray
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, underlyingErrors)
}
unsafe fn errorWithDomain_code_userInfo_(
domain: NSString,
code: NSInteger,
dict: NSDictionary,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (class ! (NSError) , errorWithDomain : domain code : code userInfo : dict)
}
unsafe fn setUserInfoValueProviderForDomain_provider_(
errorDomain: NSString,
provider: *mut ::std::os::raw::c_void,
) where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (class ! (NSError) , setUserInfoValueProviderForDomain : errorDomain provider : provider)
}
unsafe fn userInfoValueProviderForDomain_(errorDomain: NSString) -> *mut ::std::os::raw::c_void
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(NSError), userInfoValueProviderForDomain: errorDomain)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSArray(pub id);
impl std::ops::Deref for NSArray {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSArray {}
impl NSArray {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSArray), alloc) })
}
}
impl<ObjectType: 'static> INSArray<ObjectType> for NSArray {}
pub trait INSArray<ObjectType: 'static>: Sized + std::ops::Deref {
unsafe fn objectAtIndex_(&self, index: NSUInteger) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, objectAtIndex: index)
}
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithObjects_count_(
&self,
objects: *const *mut u64,
cnt: NSUInteger,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , initWithObjects : objects count : cnt)
}
unsafe fn initWithCoder_(&self, coder: NSCoder) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithCoder: coder)
}
unsafe fn count(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, count)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSDictionary(pub id);
impl std::ops::Deref for NSDictionary {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSDictionary {}
impl NSDictionary {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSDictionary), alloc) })
}
}
impl<KeyType: 'static, ObjectType: 'static> INSDictionary<KeyType, ObjectType> for NSDictionary {}
pub trait INSDictionary<KeyType: 'static, ObjectType: 'static>: Sized + std::ops::Deref {
unsafe fn objectForKey_(&self, aKey: id) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, objectForKey: aKey)
}
unsafe fn keyEnumerator(&self) -> NSEnumerator
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, keyEnumerator)
}
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithObjects_forKeys_count_(
&self,
objects: *const *mut u64,
keys: *const *mut u64,
cnt: NSUInteger,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , initWithObjects : objects forKeys : keys count : cnt)
}
unsafe fn initWithCoder_(&self, coder: NSCoder) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithCoder: coder)
}
unsafe fn count(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, count)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSSet(pub id);
impl std::ops::Deref for NSSet {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSSet {}
impl NSSet {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSSet), alloc) })
}
}
impl<ObjectType: 'static> INSSet<ObjectType> for NSSet {}
pub trait INSSet<ObjectType: 'static>: Sized + std::ops::Deref {
unsafe fn member_(&self, object: id) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, member: object)
}
unsafe fn allObjects(&self) -> NSArray
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, allObjects)
}
unsafe fn objectEnumerator(&self) -> NSEnumerator
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, objectEnumerator)
}
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithObjects_count_(
&self,
objects: *const *mut u64,
cnt: NSUInteger,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , initWithObjects : objects count : cnt)
}
unsafe fn initWithCoder_(&self, coder: NSCoder) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithCoder: coder)
}
unsafe fn count(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, count)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSEnumerator(pub id);
impl std::ops::Deref for NSEnumerator {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSEnumerator {}
impl NSEnumerator {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSEnumerator), alloc) })
}
}
impl<ObjectType: 'static> INSEnumerator<ObjectType> for NSEnumerator {}
pub trait INSEnumerator<ObjectType: 'static>: Sized + std::ops::Deref {
unsafe fn nextObject(&self) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, nextObject)
}
}
pub type NSErrorDomain = NSString;
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct CWChannel(pub id);
impl std::ops::Deref for CWChannel {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for CWChannel {}
impl CWChannel {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(CWChannel), alloc) })
}
}
impl ICWChannel for CWChannel {}
pub trait ICWChannel: Sized + std::ops::Deref {
unsafe fn isEqualToChannel_(&self, channel: CWChannel) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, isEqualToChannel: channel)
}
unsafe fn channelNumber(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, channelNumber)
}
unsafe fn channelWidth(&self) -> CWChannelWidth
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, channelWidth)
}
unsafe fn channelBand(&self) -> CWChannelBand
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, channelBand)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct CWConfiguration(pub id);
impl std::ops::Deref for CWConfiguration {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for CWConfiguration {}
impl CWConfiguration {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(CWConfiguration), alloc) })
}
}
impl ICWConfiguration for CWConfiguration {}
pub trait ICWConfiguration: Sized + std::ops::Deref {
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithConfiguration_(&self, configuration: CWConfiguration) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithConfiguration: configuration)
}
unsafe fn isEqualToConfiguration_(&self, configuration: CWConfiguration) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, isEqualToConfiguration: configuration)
}
unsafe fn networkProfiles(&self) -> NSOrderedSet
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, networkProfiles)
}
unsafe fn requireAdministratorForAssociation(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, requireAdministratorForAssociation)
}
unsafe fn requireAdministratorForPower(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, requireAdministratorForPower)
}
unsafe fn requireAdministratorForIBSSMode(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, requireAdministratorForIBSSMode)
}
unsafe fn rememberJoinedNetworks(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, rememberJoinedNetworks)
}
unsafe fn configuration() -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(class!(CWConfiguration), configuration)
}
unsafe fn configurationWithConfiguration_(configuration: CWConfiguration) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(
class!(CWConfiguration),
configurationWithConfiguration: configuration
)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct NSOrderedSet(pub id);
impl std::ops::Deref for NSOrderedSet {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for NSOrderedSet {}
impl NSOrderedSet {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(NSOrderedSet), alloc) })
}
}
impl<ObjectType: 'static> INSOrderedSet<ObjectType> for NSOrderedSet {}
pub trait INSOrderedSet<ObjectType: 'static>: Sized + std::ops::Deref {
unsafe fn objectAtIndex_(&self, idx: NSUInteger) -> id
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, objectAtIndex: idx)
}
unsafe fn indexOfObject_(&self, object: id) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, indexOfObject: object)
}
unsafe fn init(&self) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, init)
}
unsafe fn initWithObjects_count_(
&self,
objects: *const *mut u64,
cnt: NSUInteger,
) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send ! (* self , initWithObjects : objects count : cnt)
}
unsafe fn initWithCoder_(&self, coder: NSCoder) -> instancetype
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, initWithCoder: coder)
}
unsafe fn count(&self) -> NSUInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, count)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct CWNetwork(pub id);
impl std::ops::Deref for CWNetwork {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for CWNetwork {}
impl CWNetwork {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(CWNetwork), alloc) })
}
}
impl ICWNetwork for CWNetwork {}
pub trait ICWNetwork: Sized + std::ops::Deref {
unsafe fn isEqualToNetwork_(&self, network: CWNetwork) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, isEqualToNetwork: network)
}
unsafe fn supportsSecurity_(&self, security: CWSecurity) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, supportsSecurity: security)
}
unsafe fn supportsPHYMode_(&self, phyMode: CWPHYMode) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, supportsPHYMode: phyMode)
}
unsafe fn ssid(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, ssid)
}
unsafe fn ssidData(&self) -> NSData
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, ssidData)
}
unsafe fn bssid(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, bssid)
}
unsafe fn wlanChannel(&self) -> CWChannel
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, wlanChannel)
}
unsafe fn rssiValue(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, rssiValue)
}
unsafe fn noiseMeasurement(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, noiseMeasurement)
}
unsafe fn informationElementData(&self) -> NSData
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, informationElementData)
}
unsafe fn countryCode(&self) -> NSString
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, countryCode)
}
unsafe fn beaconInterval(&self) -> NSInteger
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, beaconInterval)
}
unsafe fn ibss(&self) -> bool
where
<Self as std::ops::Deref>::Target: objc::Message + Sized,
{
msg_send!(*self, ibss)
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone)]
pub struct SFAuthorization(pub id);
impl std::ops::Deref for SFAuthorization {
type Target = objc::runtime::Object;
fn deref(&self) -> &Self::Target {
unsafe { &*self.0 }
}
}
unsafe impl objc::Message for SFAuthorization {}
impl SFAuthorization {
pub fn alloc() -> Self {
Self(unsafe { msg_send!(class!(SFAuthorization), alloc) })
}
}
impl ISFAuthorization for SFAuthorization {}
pub trait ISFAuthorization: Sized + std::ops::Deref {}
pub type CWChannelWidth = NSInteger;
pub type CWChannelBand = NSInteger;
pub type CWPHYMode = NSInteger;
pub type CWSecurity = NSInteger;
pub const CWInterfaceMode_kCWInterfaceModeNone: CWInterfaceMode = 0;
pub const CWInterfaceMode_kCWInterfaceModeStation: CWInterfaceMode = 1;
pub const CWInterfaceMode_kCWInterfaceModeIBSS: CWInterfaceMode = 2;
pub const CWInterfaceMode_kCWInterfaceModeHostAP: CWInterfaceMode = 3;
pub type CWInterfaceMode = NSInteger;
pub const CWCipherKeyFlags_kCWCipherKeyFlagsNone: CWCipherKeyFlags = 0;
pub const CWCipherKeyFlags_kCWCipherKeyFlagsUnicast: CWCipherKeyFlags = 2;
pub const CWCipherKeyFlags_kCWCipherKeyFlagsMulticast: CWCipherKeyFlags = 4;
pub const CWCipherKeyFlags_kCWCipherKeyFlagsTx: CWCipherKeyFlags = 8;
pub const CWCipherKeyFlags_kCWCipherKeyFlagsRx: CWCipherKeyFlags = 16;
pub type CWCipherKeyFlags = NSUInteger;
pub const CWIBSSModeSecurity_kCWIBSSModeSecurityNone: CWIBSSModeSecurity = 0;
pub const CWIBSSModeSecurity_kCWIBSSModeSecurityWEP40: CWIBSSModeSecurity = 1;
pub const CWIBSSModeSecurity_kCWIBSSModeSecurityWEP104: CWIBSSModeSecurity = 2;
pub type CWIBSSModeSecurity = NSInteger;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __SecIdentity {
_unused: [u8; 0],
}
pub type SecIdentityRef = *mut __SecIdentity;