use crate::core::FourCharCode;
use std::fmt;
#[repr(transparent)]
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub struct AEEventID(pub FourCharCode);
impl fmt::Debug for AEEventID {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.0.fmt(f)
}
}
impl AEEventID {
#[inline]
pub const fn from_int(int: u32) -> Self {
Self(FourCharCode::from_int(int))
}
#[inline]
pub const fn from_chars(chars: [u8; 4]) -> Self {
Self(FourCharCode::from_chars(chars))
}
#[inline]
pub const fn into_int(self) -> u32 {
self.0.into_int()
}
#[inline]
pub const fn into_chars(self) -> [u8; 4] {
self.0.into_chars()
}
}
impl AEEventID {
#[doc(alias = "kAEOpenApplication")]
pub const OPEN_APPLICATION: Self = Self::from_chars(*b"oapp");
#[doc(alias = "kAEOpenDocuments")]
pub const OPEN_DOCUMENTS: Self = Self::from_chars(*b"odoc");
#[doc(alias = "kAEPrintDocuments")]
pub const PRINT_DOCUMENTS: Self = Self::from_chars(*b"pdoc");
#[doc(alias = "kAEOpenContents")]
pub const OPEN_CONTENTS: Self = Self::from_chars(*b"ocon");
#[doc(alias = "kAEQuitApplication")]
pub const QUIT_APPLICATION: Self = Self::from_chars(*b"quit");
#[doc(alias = "kAEAnswer")]
pub const ANSWER: Self = Self::from_chars(*b"ansr");
#[doc(alias = "kAEApplicationDied")]
pub const APPLICATION_DIED: Self = Self::from_chars(*b"obit");
#[doc(alias = "kAEShowPreferences")]
pub const SHOW_PREFERENCES: Self = Self::from_chars(*b"pref");
}