gdk4

Struct GrabBrokenEvent

Source
pub struct GrabBrokenEvent { /* private fields */ }
Expand description

An event related to a broken windowing system grab.

GLib type: Shared boxed type with reference counted clone semantics.

Implementations§

Source§

impl GrabBrokenEvent

Source

pub fn as_ptr(&self) -> *mut GdkGrabBrokenEvent

Return the inner pointer to the underlying C value.

Source

pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GdkGrabBrokenEvent) -> &Self

Borrows the underlying C value.

Source§

impl GrabBrokenEvent

Source

pub fn grab_surface(&self) -> Surface

Extracts the grab surface from a grab broken event.

§Returns

the grab surface of @self

Source

pub fn is_implicit(&self) -> bool

Checks whether the grab broken event is for an implicit grab.

§Returns

true if the an implicit grab was broken

Source§

impl GrabBrokenEvent

Source

pub fn upcast(self) -> Event

Source

pub fn upcast_ref(&self) -> &Event

Methods from Deref<Target = Event>§

Source

pub fn as_ptr(&self) -> *mut GdkEvent

Return the inner pointer to the underlying C value.

Source

pub const NONE: Option<&'static Event> = None

Source

pub fn axes(&self) -> Option<Vec<f64>>

Extracts all axis values from an event.

To find out which axes are used, use DeviceTool::axes() on the device tool returned by device_tool().

§Returns

true on success, otherwise false

§axes

the array of values for all axes

Source

pub fn axis(&self, axis_use: AxisUse) -> Option<f64>

Extract the axis value for a particular axis use from an event structure.

To find out which axes are used, use DeviceTool::axes() on the device tool returned by device_tool().

§axis_use

the axis use to look for

§Returns

true if the specified axis was found, otherwise false

§value

location to store the value found

Source

pub fn device(&self) -> Option<Device>

Returns the device of an event.

§Returns

a Device

Source

pub fn device_tool(&self) -> Option<DeviceTool>

Returns a DeviceTool representing the tool that caused the event.

If the was not generated by a device that supports different tools (such as a tablet), this function will return None.

Note: the DeviceTool will be constant during the application lifetime, if settings must be stored persistently across runs, see DeviceTool::serial().

§Returns

The current device tool

Source

pub fn display(&self) -> Option<Display>

Retrieves the display associated to the @self.

§Returns

a Display

Source

pub fn event_sequence(&self) -> EventSequence

Returns the event sequence to which the event belongs.

Related touch events are connected in a sequence. Other events typically don’t have event sequence information.

§Returns

the event sequence that the event belongs to

Source

pub fn event_type(&self) -> EventType

Retrieves the type of the event.

§Returns

a EventType

Source

pub fn history(&self) -> Vec<TimeCoord>

Retrieves the history of the device that @self is for, as a list of time and coordinates.

The history includes positions that are not delivered as separate events to the application because they occurred in the same frame as @self.

Note that only motion and scroll events record history, and motion events do it only if one of the mouse buttons is down, or the device has a tool.

§Returns

an array of time and coordinates

Source

pub fn modifier_state(&self) -> ModifierType

Returns the modifier state field of an event.

§Returns

the modifier state of @self

Source

pub fn is_pointer_emulated(&self) -> bool

Returns whether this event is an ‘emulated’ pointer event.

Emulated pointer events typically originate from a touch events.

§Returns

true if this event is emulated

Source

pub fn position(&self) -> Option<(f64, f64)>

Extract the event surface relative x/y coordinates from an event.

This position is in surface coordinates.

§Returns

whether the positions were set

§x

location to put event surface x coordinate

§y

location to put event surface y coordinate

Source

pub fn seat(&self) -> Option<Seat>

Returns the seat that originated the event.

§Returns

a Seat.

Source

pub fn surface(&self) -> Option<Surface>

Extracts the surface associated with an event.

§Returns

The Surface associated with the event

Source

pub fn time(&self) -> u32

Returns the timestamp of @self.

Not all events have timestamps. In that case, this function returns GDK_CURRENT_TIME.

§Returns

timestamp field from @self

Source

pub fn triggers_context_menu(&self) -> bool

Returns whether a Event should trigger a context menu, according to platform conventions.

The right mouse button typically triggers context menus. On macOS, Control+left mouse button also triggers.

This function should always be used instead of simply checking for

⚠️ The following code is in c ⚠️

event->button == GDK_BUTTON_SECONDARY
§Returns

true if the event should trigger a context menu.

Source

pub fn is<T: EventKind>(&self) -> bool

Source

pub fn type_(&self) -> Type

Source

pub fn downcast_ref<T: EventKind>(&self) -> Option<&T>

Source

pub fn angle(&self, event: impl AsRef<Event>) -> Option<f64>

Returns the relative angle from @event1 to @event2.

The relative angle is the angle between the X axis and the line through both events’ positions. The rotation direction for positive angles is from the positive X axis towards the positive Y axis.

This assumes that both events have X/Y information. If not, this function returns false.

§event1

first Event

§event2

second Event

§Returns

true if the angle could be calculated.

§angle

return location for the relative angle between both events

Source

pub fn center(&self, event: impl AsRef<Event>) -> Option<(f64, f64)>

Returns the point halfway between the events’ positions.

This assumes that both events have X/Y information. If not, this function returns false.

§event1

first Event

§event2

second Event

§Returns

true if the center could be calculated.

§x

return location for the X coordinate of the center

§y

return location for the Y coordinate of the center

Source

pub fn distance(&self, event: impl AsRef<Event>) -> Option<f64>

Returns the distance between the event locations.

This assumes that both events have X/Y information. If not, this function returns false.

§event1

first Event

§event2

second Event

§Returns

true if the distance could be calculated.

§distance

return location for the distance

Trait Implementations§

Source§

impl AsRef<Event> for GrabBrokenEvent

Source§

fn as_ref(&self) -> &Event

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for GrabBrokenEvent

Source§

fn clone(&self) -> Self

Makes a clone of this shared reference.

This increments the strong reference count of the reference. Dropping the reference will decrement it again.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GrabBrokenEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for GrabBrokenEvent

Source§

type Target = Event

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl EventKind for GrabBrokenEvent

Source§

fn event_types() -> &'static [EventType]

Source§

impl StaticType for GrabBrokenEvent

Source§

fn static_type() -> Type

Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize, ) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StaticTypeExt for T
where T: StaticType,

Source§

fn ensure_type()

Ensures that the type has been registered with the type system.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TransparentType for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.