[−][src]Struct wlroots::cursor::Cursor
Methods
impl Cursor
[src]
impl Cursor
pub fn create(cursor_handler: Box<dyn Handler>) -> Handle
[src]
pub fn create(cursor_handler: Box<dyn Handler>) -> Handle
pub fn weak_reference(&self) -> Handle
[src]
pub fn weak_reference(&self) -> Handle
Get a weak reference to this Cursor
.
pub fn attach_output_layout(&mut self, output_layout: &mut Layout)
[src]
pub fn attach_output_layout(&mut self, output_layout: &mut Layout)
Attach this cursor to an output layout.
pub fn deattach_output_layout(&mut self)
[src]
pub fn deattach_output_layout(&mut self)
pub fn coords(&self) -> (f64, f64)
[src]
pub fn coords(&self) -> (f64, f64)
Get the coordinates the cursor is located at.
pub fn warp<'this, O>(&'this mut self, dev: O, x: f64, y: f64) -> bool where
O: Into<Option<&'this Device>>,
[src]
pub fn warp<'this, O>(&'this mut self, dev: O, x: f64, y: f64) -> bool where
O: Into<Option<&'this Device>>,
Warp the cursor to the given x and y in layout coordinates. If x and y are out of the layout boundaries or constraints, no warp will happen.
dev
may be passed to respect device mapping constraints. If dev
is None,
device mapping constraints will be ignored.
Returns true when the mouse warp was successful.
pub fn warp_absolute<'this, O>(&'this mut self, dev: O, x_mm: f64, y_mm: f64) where
O: Into<Option<&'this Device>>,
[src]
pub fn warp_absolute<'this, O>(&'this mut self, dev: O, x_mm: f64, y_mm: f64) where
O: Into<Option<&'this Device>>,
pub fn move_to<'this, O>(&'this mut self, dev: O, delta_x: f64, delta_y: f64) where
O: Into<Option<&'this Device>>,
[src]
pub fn move_to<'this, O>(&'this mut self, dev: O, delta_x: f64, delta_y: f64) where
O: Into<Option<&'this Device>>,
Move the cursor in the direction of the given x and y coordinates.
dev
may be passed to respect device mapping constraints. If dev
is None,
device mapping constraints will be ignored.
pub fn set_cursor_image(&mut self, image: &Image)
[src]
pub fn set_cursor_image(&mut self, image: &Image)
Sets the image of the cursor to the image.
pub fn set_surface<'this, O>(
&'this mut self,
surface: O,
hotspot_x: i32,
hotspot_y: i32
) where
O: Into<Option<&'this Surface>>,
[src]
pub fn set_surface<'this, O>(
&'this mut self,
surface: O,
hotspot_x: i32,
hotspot_y: i32
) where
O: Into<Option<&'this Surface>>,
Set the cursor surface. The surface can be committed to update the cursor image. The surface position is substracted from the hotspot.
A None
surface commit hides the cursor.
pub fn attach_input_device(&mut self, dev: &Device)
[src]
pub fn attach_input_device(&mut self, dev: &Device)
Attaches this input device to this cursor. The input device must be one of:
- WLR_INPUT_DEVICE_POINTER
- WLR_INPUT_DEVICE_TOUCH
- WLR_INPUT_DEVICE_TABLET_TOOL
TODO Make this impossible to mess up with using an enum Note that it's safe to use the wrong type.
pub fn deattach_input_device(&mut self, dev: &Device)
[src]
pub fn deattach_input_device(&mut self, dev: &Device)
Deattaches the input device from this cursor.
pub fn map_to_output<'a, T: Into<Option<&'a mut Output>>>(&mut self, output: T)
[src]
pub fn map_to_output<'a, T: Into<Option<&'a mut Output>>>(&mut self, output: T)
Attaches this cursor to the given output, which must be among the outputs in the current output_layout for this cursor.
pub fn map_input_to_output<'output, O>(&mut self, dev: &Device, output: O) where
O: Into<Option<&'output Output>>,
[src]
pub fn map_input_to_output<'output, O>(&mut self, dev: &Device, output: O) where
O: Into<Option<&'output Output>>,
Maps all input from a specific input device to a given output.
The input device must be attached to this cursor and the output must be among the outputs in the attached output layout.
pub fn map_to_region(&mut self, area: Area)
[src]
pub fn map_to_region(&mut self, area: Area)
Maps this cursor to an arbitrary region on the associated wlr_output_layout.
pub fn map_input_to_region(&mut self, dev: &Device, area: Area)
[src]
pub fn map_input_to_region(&mut self, dev: &Device, area: Area)
Maps inputs from this input device to an arbitrary region on the associated wlr_output_layout.
The input device must be attached to this cursor.
pub fn absolute_to_layout_coords(
&mut self,
dev: &Device,
x_mm: f64,
y_mm: f64
) -> (f64, f64)
[src]
pub fn absolute_to_layout_coords(
&mut self,
dev: &Device,
x_mm: f64,
y_mm: f64
) -> (f64, f64)
Convert absolute coordinates to layout coordinates for the device.
Coordinates are in (x, y).
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more