use oxivgl_sys::*;
use crate::widgets::AsLvHandle;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct GridnavCtrl(pub u32);
impl GridnavCtrl {
pub const NONE: Self = Self(0x0);
pub const ROLLOVER: Self = Self(0x1);
pub const SCROLL_FIRST: Self = Self(0x2);
pub const HORIZONTAL_MOVE_ONLY: Self = Self(0x4);
pub const VERTICAL_MOVE_ONLY: Self = Self(0x8);
}
impl core::ops::BitOr for GridnavCtrl {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
pub fn gridnav_add(obj: &impl AsLvHandle, ctrl: GridnavCtrl) {
unsafe { lv_gridnav_add(obj.lv_handle(), ctrl.0 as lv_gridnav_ctrl_t) };
}
pub fn gridnav_remove(obj: &impl AsLvHandle) {
unsafe { lv_gridnav_remove(obj.lv_handle()) };
}