mod accelerator;
#[cfg(any(target_os = "macos", target_os = "windows"))]
mod native;
#[cfg(any(target_os = "macos", target_os = "windows"))]
pub use accelerator::to_muda;
#[allow(deprecated)]
pub use accelerator::{Accelerator, Modifiers, menu_accelerator};
pub use ashlar_command::menu::{Item, MAX_DEPTH, MAX_NODES, MAX_TEXT, MenuNode, MenuSpec, Path, Role, Submenu, SubmenuRole, menu_chord};
#[cfg(any(target_os = "macos", target_os = "windows"))]
pub use native::NativeMenuBar;
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
use crate::{NativeError, Result};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Update {
Unchanged,
Patched,
Rebuilt,
}
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
pub struct NativeMenuBar(());
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
impl NativeMenuBar {
pub fn install(_spec: &MenuSpec, _waker: crate::Waker) -> Result<Self> {
Err(NativeError::Unsupported)
}
pub fn attach_window(&self, _window: &impl raw_window_handle::HasWindowHandle) -> Result<()> {
Err(NativeError::Unsupported)
}
pub fn update(&mut self, _spec: &MenuSpec) -> Result<Update> {
Err(NativeError::Unsupported)
}
pub fn try_recv(&self) -> Option<String> {
None
}
pub fn drain(&self) -> Vec<String> {
vec![]
}
}