use super::FallibleContext;
use crate::{MouseButton, GenericError};
pub trait MouseContext: FallibleContext {
fn mouse_move_rel(&mut self, dx: i32, dy: i32) -> Result<(), GenericError<Self::PlatformError>>;
fn mouse_move_abs(&mut self, x: i32, y: i32) -> Result<(), GenericError<Self::PlatformError>>;
fn mouse_scroll(&mut self, dx: i32, dy: i32) -> Result<(), GenericError<Self::PlatformError>>;
fn mouse_down(&mut self, button: MouseButton) -> Result<(), GenericError<Self::PlatformError>>;
fn mouse_up(&mut self, button: MouseButton) -> Result<(), GenericError<Self::PlatformError>>;
fn mouse_click(&mut self, button: MouseButton) -> Result<(), GenericError<Self::PlatformError>> {
self.mouse_down(button)?;
self.mouse_up(button)
}
}