[]Struct gdk::DragContext

pub struct DragContext(_, _);

Implementations

impl DragContext[src]

pub fn get_actions(&self) -> DragAction[src]

Determines the bitmask of actions proposed by the source if DragContext::get_suggested_action returns DragAction::Ask.

Returns

the DragAction flags

pub fn get_dest_window(&self) -> Window[src]

Returns the destination window for the DND operation.

Returns

a Window

pub fn get_device(&self) -> Device[src]

Returns the Device associated to the drag context.

Returns

The Device associated to self.

pub fn get_drag_window(&self) -> Option<Window>[src]

Returns the window on which the drag icon should be rendered during the drag operation. Note that the window may not be available until the drag operation has begun. GDK will move the window in accordance with the ongoing drag operation. The window is owned by self and will be destroyed when the drag operation is over.

Feature: v3_20

Returns

the drag window, or None

pub fn get_protocol(&self) -> DragProtocol[src]

Returns the drag protocol that is used by this context.

Returns

the drag protocol

pub fn get_selected_action(&self) -> DragAction[src]

Determines the action chosen by the drag destination.

Returns

a DragAction value

pub fn get_source_window(&self) -> Window[src]

Returns the Window where the DND operation started.

Returns

a Window

pub fn get_suggested_action(&self) -> DragAction[src]

Determines the suggested drag action of the context.

Returns

a DragAction value

pub fn list_targets(&self) -> Vec<Atom>[src]

Retrieves the list of targets of the context.

Returns

a glib::List of targets

pub fn manage_dnd<P: IsA<Window>>(
    &self,
    ipc_window: &P,
    actions: DragAction
) -> bool
[src]

Requests the drag and drop operation to be managed by self. When a drag and drop operation becomes managed, the DragContext will internally handle all input and source-side EventDND events as required by the windowing system.

Once the drag and drop operation is managed, the drag context will emit the following signals:

  • The DragContext::action-changed signal whenever the final action to be performed by the drag and drop operation changes.
  • The DragContext::drop-performed signal after the user performs the drag and drop gesture (typically by releasing the mouse button).
  • The DragContext::dnd-finished signal after the drag and drop operation concludes (after all GdkSelection transfers happen).
  • The DragContext::cancel signal if the drag and drop operation is finished but doesn't happen over an accepting destination, or is cancelled through other means.

Feature: v3_20

ipc_window

Window to use for IPC messaging/events

actions

the actions supported by the drag source

Returns

true if the drag and drop operation is managed.

pub fn set_device(&self, device: &Device)[src]

Associates a Device to self, so all Drag and Drop events for self are emitted as if they came from this device.

device

a Device

pub fn set_hotspot(&self, hot_x: i32, hot_y: i32)[src]

Sets the position of the drag window that will be kept under the cursor hotspot. Initially, the hotspot is at the top left corner of the drag window.

Feature: v3_20

hot_x

x coordinate of the drag window hotspot

hot_y

y coordinate of the drag window hotspot

pub fn connect_action_changed<F: Fn(&DragContext, DragAction) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

A new action is being chosen for the drag and drop operation.

This signal will only be emitted if the DragContext manages the drag and drop operation. See DragContext::manage_dnd for more information.

Feature: v3_20

action

The action currently chosen

pub fn connect_cancel<F: Fn(&DragContext, DragCancelReason) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The drag and drop operation was cancelled.

This signal will only be emitted if the DragContext manages the drag and drop operation. See DragContext::manage_dnd for more information.

Feature: v3_20

reason

The reason the context was cancelled

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

The drag and drop operation was finished, the drag destination finished reading all data. The drag source can now free all miscellaneous data.

This signal will only be emitted if the DragContext manages the drag and drop operation. See DragContext::manage_dnd for more information.

Feature: v3_20

pub fn connect_drop_performed<F: Fn(&DragContext, i32) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

The drag and drop operation was performed on an accepting client.

This signal will only be emitted if the DragContext manages the drag and drop operation. See DragContext::manage_dnd for more information.

Feature: v3_20

time

the time at which the drop happened.

impl DragContext[src]

pub fn drag_get_selection(&self) -> Atom[src]

pub fn drag_abort(&self, time_: u32)[src]

pub fn drop_reply(&self, accepted: bool, time_: u32)[src]

pub fn drop(&self, time_: u32)[src]

pub fn drag_find_window_for_screen(
    &self,
    drag_window: &Window,
    screen: &Screen,
    x_root: i32,
    y_root: i32
) -> (Option<Window>, DragProtocol)
[src]

pub fn drag_motion(
    &self,
    dest_window: &Window,
    protocol: DragProtocol,
    x_root: i32,
    y_root: i32,
    suggested_action: DragAction,
    possible_actions: DragAction,
    time_: u32
) -> bool
[src]

pub fn drop_finish(&self, success: bool, time_: u32)[src]

pub fn drag_status(&self, action: DragAction, time_: u32)[src]

pub fn drag_drop_succeeded(&self) -> bool[src]

pub fn drag_begin(window: &Window, targets: &[&Atom]) -> Option<DragContext>[src]

pub fn drag_begin_for_device<P: IsA<Device>>(
    window: &Window,
    device: &P,
    targets: &[&Atom]
) -> Option<DragContext>
[src]

pub fn drag_begin_from_point<P: IsA<Device>>(
    window: &Window,
    device: &P,
    targets: &[&Atom],
    x_root: i32,
    y_root: i32
) -> Option<DragContext>
[src]

pub fn drag_drop_done(&self, success: bool)[src]

Trait Implementations

impl Clone for DragContext

impl Debug for DragContext

impl Display for DragContext[src]

impl Eq for DragContext

impl Hash for DragContext

impl Ord for DragContext

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

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

impl StaticType for DragContext

Auto Trait Implementations

impl RefUnwindSafe for DragContext

impl !Send for DragContext

impl !Sync for DragContext

impl Unpin for DragContext

impl UnwindSafe for DragContext

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> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

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.