[]Struct gdk::Seat

pub struct Seat(_, _);

The Seat object represents a collection of input devices that belong to a user.

Feature: v3_20

Implementations

impl Seat[src]

pub fn get_capabilities(&self) -> SeatCapabilities[src]

Returns the capabilities this Seat currently has.

Feature: v3_20

Returns

the seat capabilities

pub fn get_display(&self) -> Option<Display>[src]

Returns the Display this seat belongs to.

Feature: v3_20

Returns

a Display. This object is owned by GTK+ and must not be freed.

pub fn get_keyboard(&self) -> Option<Device>[src]

Returns the master device that routes keyboard events.

Feature: v3_20

Returns

a master Device with keyboard capabilities. This object is owned by GTK+ and must not be freed.

pub fn get_pointer(&self) -> Option<Device>[src]

Returns the master device that routes pointer events.

Feature: v3_20

Returns

a master Device with pointer capabilities. This object is owned by GTK+ and must not be freed.

pub fn get_slaves(&self, capabilities: SeatCapabilities) -> Vec<Device>[src]

Returns the slave devices that match the given capabilities.

Feature: v3_20

capabilities

capabilities to get devices for

Returns

A list of GdkDevices. The list must be freed with glib::List::free, the elements are owned by GDK and must not be freed.

pub fn grab<P: IsA<Window>>(
    &self,
    window: &P,
    capabilities: SeatCapabilities,
    owner_events: bool,
    cursor: Option<&Cursor>,
    event: Option<&Event>,
    prepare_func: Option<&mut dyn FnMut(&Seat, &Window)>
) -> GrabStatus
[src]

Grabs the seat so that all events corresponding to the given capabilities are passed to this application until the seat is ungrabbed with Seat::ungrab, or the window becomes hidden. This overrides any previous grab on the seat by this client.

As a rule of thumb, if a grab is desired over SeatCapabilities::Pointer, all other "pointing" capabilities (eg. SeatCapabilities::Touch) should be grabbed too, so the user is able to interact with all of those while the grab holds, you should thus use SeatCapabilities::AllPointing most commonly.

Grabs are used for operations which need complete control over the events corresponding to the given capabilities. For example in GTK+ this is used for Drag and Drop operations, popup menus and such.

Note that if the event mask of a Window has selected both button press and button release events, or touch begin and touch end, then a press event will cause an automatic grab until the button is released, equivalent to a grab on the window with owner_events set to true. This is done because most applications expect to receive paired press and release events.

If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the EventGrabBroken events that are emitted when the grab ends unvoluntarily.

Feature: v3_20

window

the Window which will own the grab

capabilities

capabilities that will be grabbed

owner_events

if false then all device events are reported with respect to window and are only reported if selected by event_mask. If true then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to window and only if selected by event_mask. In either mode, unreported events are discarded.

cursor

the cursor to display while the grab is active. If this is None then the normal cursors are used for window and its descendants, and the cursor for window is used elsewhere.

event

the event that is triggering the grab, or None if none is available.

prepare_func

function to prepare the window to be grabbed, it can be None if window is visible before this call.

prepare_func_data

user data to pass to prepare_func

Returns

GrabStatus::Success if the grab was successful.

pub fn ungrab(&self)[src]

Releases a grab added through Seat::grab.

Feature: v3_20

pub fn connect_device_added<F: Fn(&Seat, &Device) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::device-added signal is emitted when a new input device is related to this seat.

Feature: v3_20

device

the newly added Device.

pub fn connect_device_removed<F: Fn(&Seat, &Device) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::device-removed signal is emitted when an input device is removed (e.g. unplugged).

Feature: v3_20

device

the just removed Device.

pub fn connect_tool_added<F: Fn(&Seat, &DeviceTool) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The ::tool-added signal is emitted whenever a new tool is made known to the seat. The tool may later be assigned to a device (i.e. on proximity with a tablet). The device will emit the Device::tool-changed signal accordingly.

A same tool may be used by several devices.

Feature: v3_22

tool

the new DeviceTool known to the seat

pub fn connect_tool_removed<F: Fn(&Seat, &DeviceTool) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This signal is emitted whenever a tool is no longer known to this seat.

Feature: v3_22

tool

the just removed DeviceTool

Trait Implementations

impl Clone for Seat

impl Debug for Seat

impl Display for Seat[src]

impl Eq for Seat

impl Hash for Seat

impl Ord for Seat

impl<T: ObjectType> PartialEq<T> for Seat

impl<T: ObjectType> PartialOrd<T> for Seat

impl StaticType for Seat

Auto Trait Implementations

impl RefUnwindSafe for Seat

impl !Send for Seat

impl !Sync for Seat

impl Unpin for Seat

impl UnwindSafe for Seat

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.