use crate::{error::Result, key_types::{KeyboardKey,MouseButton}};
pub use abi_stable::type_layout::TypeLayout;
use cglue::prelude::v1::*;
#[cfg_attr(feature = "plugins", cglue_trait, cglue_forward)] pub trait Loadable {
fn name(&self) -> abi_stable::std_types::RString;
fn capabilities(&self) -> u8;
}
cglue_trait_group!(ControllerFeatures, { Loadable }, { KeyboardWriter, MouseWriter, Clone });
#[cfg_attr(feature = "plugins", cglue_trait, cglue_forward)]
#[int_result]
pub trait KeyboardWriter: Send {
fn send_key_down(&mut self, key: KeyboardKey) -> Result<()>;
fn send_key_up(&mut self, key: KeyboardKey) -> Result<()>;
fn press_key(&mut self, key: KeyboardKey) -> Result<()>;
fn clear_keys(&mut self) -> Result<()>;
}
#[cfg_attr(feature = "plugins", cglue_trait, cglue_forward)]
#[int_result]
pub trait MouseWriter: Send {
fn send_button_down(&mut self, key: MouseButton) -> Result<()>;
fn send_button_up(&mut self, key: MouseButton) -> Result<()>;
fn click_button(&mut self, key: MouseButton) -> Result<()>;
fn clear_buttons(&mut self) -> Result<()>;
fn mouse_move_relative(&mut self, x: i32, y: i32) -> Result<()>;
}