gdk4::prelude

Trait DragExt

Source
pub trait DragExt: IsA<Drag> + 'static {
Show 18 methods // Provided methods fn drop_done(&self, success: bool) { ... } fn actions(&self) -> DragAction { ... } fn content(&self) -> ContentProvider { ... } fn device(&self) -> Device { ... } fn display(&self) -> Display { ... } fn drag_surface(&self) -> Option<Surface> { ... } fn formats(&self) -> ContentFormats { ... } fn selected_action(&self) -> DragAction { ... } fn surface(&self) -> Surface { ... } fn set_hotspot(&self, hot_x: i32, hot_y: i32) { ... } fn set_actions(&self, actions: DragAction) { ... } fn set_selected_action(&self, selected_action: DragAction) { ... } fn connect_cancel<F: Fn(&Self, DragCancelReason) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_dnd_finished<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_drop_performed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_actions_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_display_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_selected_action_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Drag methods.

§Implementors

Drag

Provided Methods§

Source

fn drop_done(&self, success: bool)

Informs GDK that the drop ended.

Passing false for @success may trigger a drag cancellation animation.

This function is called by the drag source, and should be the last call before dropping the reference to the @self.

The Drag will only take the first drop_done() call as effective, if this function is called multiple times, all subsequent calls will be ignored.

§success

whether the drag was ultimatively successful

Source

fn actions(&self) -> DragAction

Determines the bitmask of possible actions proposed by the source.

§Returns

the DragAction flags

Source

fn content(&self) -> ContentProvider

Returns the ContentProvider associated to the Drag object.

§Returns

The ContentProvider associated to @self.

Source

fn device(&self) -> Device

Returns the Device associated to the Drag object.

§Returns

The Device associated to @self.

Source

fn display(&self) -> Display

Gets the Display that the drag object was created for.

§Returns

a Display

Source

fn drag_surface(&self) -> Option<Surface>

Returns the surface on which the drag icon should be rendered during the drag operation.

Note that the surface may not be available until the drag operation has begun. GDK will move the surface in accordance with the ongoing drag operation. The surface is owned by @self and will be destroyed when the drag operation is over.

§Returns

the drag surface

Source

fn formats(&self) -> ContentFormats

Retrieves the formats supported by this Drag object.

§Returns

a ContentFormats

Source

fn selected_action(&self) -> DragAction

Determines the action chosen by the drag destination.

§Returns

a DragAction value

Source

fn surface(&self) -> Surface

Returns the Surface where the drag originates.

§Returns

The Surface where the drag originates

Source

fn set_hotspot(&self, hot_x: i32, hot_y: i32)

Sets the position of the drag surface that will be kept under the cursor hotspot.

Initially, the hotspot is at the top left corner of the drag surface.

§hot_x

x coordinate of the drag surface hotspot

§hot_y

y coordinate of the drag surface hotspot

Source

fn set_actions(&self, actions: DragAction)

The possible actions of this drag.

Source

fn set_selected_action(&self, selected_action: DragAction)

The currently selected action of the drag.

Source

fn connect_cancel<F: Fn(&Self, DragCancelReason) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the drag operation is cancelled.

§reason

The reason the drag was cancelled

Source

fn connect_dnd_finished<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the destination side has finished reading all data.

The drag object can now free all miscellaneous data.

Source

fn connect_drop_performed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the drop operation is performed on an accepting client.

Source

fn connect_actions_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_display_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_selected_action_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<O: IsA<Drag>> DragExt for O