use {
    crate::{
        object::Version,
        wire::{WpCursorShapeManagerV1Id, wp_cursor_shape_manager_v1::*},
        wl_usr::{UsrCon, usr_object::UsrObject},
    },
    std::{convert::Infallible, rc::Rc},
};

pub struct UsrWpCursorShapeManagerV1 {
    pub id: WpCursorShapeManagerV1Id,
    pub con: Rc<UsrCon>,
    pub version: Version,
}

impl WpCursorShapeManagerV1EventHandler for UsrWpCursorShapeManagerV1 {
    type Error = Infallible;
}

usr_object_base! {
    self = UsrWpCursorShapeManagerV1 = WpCursorShapeManagerV1;
    version = self.version;
}

impl UsrObject for UsrWpCursorShapeManagerV1 {
    fn destroy(&self) {
        self.con.request(Destroy { self_id: self.id })
    }
}
