#[expect(unused_imports)]
use crate::xkb::keymap::{KeyType, Keymap};
use {
crate::xkb::keymap::{Indicator, Key, KeyGroup, KeyLevel, KeyTypeMapping, VirtualModifier},
indexmap::map::Values,
std::slice::Iter,
};
pub struct VirtualModifiers<'a> {
pub(super) modifiers: Iter<'a, VirtualModifier>,
}
pub struct Keys<'a> {
pub(super) keys: Values<'a, crate::Keycode, Key>,
}
pub struct Groups<'a> {
pub(super) groups: Iter<'a, Option<KeyGroup>>,
}
pub struct Levels<'a> {
pub(super) levels: Iter<'a, KeyLevel>,
}
pub struct Mappings<'a> {
pub(super) mappings: Iter<'a, KeyTypeMapping>,
}
pub struct Indicators<'a> {
pub(super) indicators: Iter<'a, Indicator>,
}
impl<'a> Iterator for Mappings<'a> {
type Item = &'a KeyTypeMapping;
fn next(&mut self) -> Option<Self::Item> {
self.mappings.next()
}
}
impl<'a> Iterator for Levels<'a> {
type Item = &'a KeyLevel;
fn next(&mut self) -> Option<Self::Item> {
self.levels.next()
}
}
impl<'a> Iterator for Groups<'a> {
type Item = Option<&'a KeyGroup>;
fn next(&mut self) -> Option<Self::Item> {
self.groups.next().map(|v| v.as_ref())
}
}
impl<'a> Iterator for VirtualModifiers<'a> {
type Item = &'a VirtualModifier;
fn next(&mut self) -> Option<Self::Item> {
self.modifiers.next()
}
}
impl<'a> Iterator for Keys<'a> {
type Item = &'a Key;
fn next(&mut self) -> Option<Self::Item> {
self.keys.next()
}
}
impl<'a> Iterator for Indicators<'a> {
type Item = &'a Indicator;
fn next(&mut self) -> Option<Self::Item> {
self.indicators.next()
}
}