[−]Struct gdk::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]
pub fn get_device(&self) -> Device
[src]
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]
pub fn get_selected_action(&self) -> DragAction
[src]
pub fn get_source_window(&self) -> Window
[src]
pub fn get_suggested_action(&self) -> DragAction
[src]
pub fn list_targets(&self) -> Vec<Atom>
[src]
pub fn manage_dnd<P: IsA<Window>>(
&self,
ipc_window: &P,
actions: DragAction
) -> bool
[src]
&self,
ipc_window: &P,
actions: DragAction
) -> bool
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 allGdkSelection
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]
&self,
f: F
) -> SignalHandlerId
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]
&self,
f: F
) -> SignalHandlerId
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]
&self,
f: F
) -> SignalHandlerId
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]
&self,
f: F
) -> SignalHandlerId
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]
&self,
drag_window: &Window,
screen: &Screen,
x_root: i32,
y_root: i32
) -> (Option<Window>, DragProtocol)
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]
&self,
dest_window: &Window,
protocol: DragProtocol,
x_root: i32,
y_root: i32,
suggested_action: DragAction,
possible_actions: DragAction,
time_: u32
) -> bool
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]
window: &Window,
device: &P,
targets: &[&Atom]
) -> Option<DragContext>
pub fn drag_begin_from_point<P: IsA<Device>>(
window: &Window,
device: &P,
targets: &[&Atom],
x_root: i32,
y_root: i32
) -> Option<DragContext>
[src]
window: &Window,
device: &P,
targets: &[&Atom],
x_root: i32,
y_root: i32
) -> Option<DragContext>
pub fn drag_drop_done(&self, success: bool)
[src]
Trait Implementations
impl Clone for DragContext
fn clone(&self) -> DragContext
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DragContext
impl Display for DragContext
[src]
impl Eq for DragContext
impl Hash for DragContext
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for DragContext
fn cmp(&self, other: &DragContext) -> Ordering
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: ObjectType> PartialEq<T> for DragContext
impl<T: ObjectType> PartialOrd<T> for DragContext
fn partial_cmp(&self, other: &T) -> Option<Ordering>
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StaticType for DragContext
fn static_type() -> Type
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Super, Sub> CanDowncast<Sub> for Super where
Sub: IsA<Super>,
Super: IsA<Super>,
Sub: IsA<Super>,
Super: IsA<Super>,
impl<T> Cast for T where
T: ObjectType,
T: ObjectType,
fn upcast<T>(self) -> T where
Self: IsA<T>,
T: ObjectType,
Self: IsA<T>,
T: ObjectType,
fn upcast_ref<T>(&self) -> &T where
Self: IsA<T>,
T: ObjectType,
Self: IsA<T>,
T: ObjectType,
fn downcast<T>(self) -> Result<T, Self> where
Self: CanDowncast<T>,
T: ObjectType,
Self: CanDowncast<T>,
T: ObjectType,
fn downcast_ref<T>(&self) -> Option<&T> where
Self: CanDowncast<T>,
T: ObjectType,
Self: CanDowncast<T>,
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self> where
T: ObjectType,
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T> where
T: ObjectType,
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> T where
T: ObjectType,
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &T where
T: ObjectType,
T: ObjectType,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ObjectExt for T where
T: ObjectType,
T: ObjectType,
fn is<U>(&self) -> bool where
U: StaticType,
U: StaticType,
fn get_type(&self) -> Type
fn get_object_class(&self) -> &ObjectClass
fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
fn set_property<'a, N>(
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>,
&self,
property_name: N,
value: &dyn ToValue
) -> Result<(), BoolError> where
N: Into<&'a str>,
fn get_property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
N: Into<&'a str>,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD) where
QD: 'static,
QD: 'static,
unsafe fn get_qdata<QD>(&self, key: Quark) -> Option<&QD> where
QD: 'static,
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD> where
QD: 'static,
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD) where
QD: 'static,
QD: 'static,
unsafe fn get_data<QD>(&self, key: &str) -> Option<&QD> where
QD: 'static,
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD> where
QD: 'static,
QD: 'static,
fn block_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn stop_signal_emission(&self, signal_name: &str)
fn disconnect(&self, handler_id: SignalHandlerId)
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Send + Sync + Fn(&T, &ParamSpec),
F: 'static + Send + Sync + Fn(&T, &ParamSpec),
unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
fn notify<'a, N>(&self, property_name: N) where
N: Into<&'a str>,
N: Into<&'a str>,
fn notify_by_pspec(&self, pspec: &ParamSpec)
fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
N: Into<&'a str>,
fn get_property_type<'a, N>(&self, property_name: N) -> Option<Type> where
N: Into<&'a str>,
N: Into<&'a str>,
fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
N: Into<&'a str>,
fn list_properties(&self) -> Vec<ParamSpec>
fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
fn emit<'a, N>(
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>,
&self,
signal_name: N,
args: &[&dyn ToValue]
) -> Result<Option<Value>, BoolError> where
N: Into<&'a str>,
fn downgrade(&self) -> WeakRef<T>
fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
M: Into<&'a str>,
N: Into<&'a str>,
O: ObjectType,
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
M: Into<&'a str>,
N: Into<&'a str>,
O: ObjectType,
fn ref_count(&self) -> u32
impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_container_from_slice(
_t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
_t: &'a [T]
) -> (*const GList, <T as ToGlibContainerFromSlice<'a, *const GList>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GList
impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_container_from_slice(
_t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
_t: &'a [T]
) -> (*const GPtrArray, <T as ToGlibContainerFromSlice<'a, *const GPtrArray>>::Storage)
fn to_glib_full_from_slice(_t: &[T]) -> *const GPtrArray
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
t: &'a [T]
) -> (*mut GArray, <T as ToGlibContainerFromSlice<'a, *mut GArray>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GArray
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
t: &'a [T]
) -> (*mut GList, <T as ToGlibContainerFromSlice<'a, *mut GList>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GList
impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)
fn to_glib_none_from_slice(
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_container_from_slice(
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
t: &'a [T]
) -> (*mut GPtrArray, <T as ToGlibContainerFromSlice<'a, *mut GPtrArray>>::Storage)
fn to_glib_full_from_slice(t: &[T]) -> *mut GPtrArray
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: ToValue + SetValue + Send + ?Sized,
T: ToValue + SetValue + Send + ?Sized,
fn to_send_value(&self) -> SendValue
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToValue for T where
T: SetValue + ?Sized,
T: SetValue + ?Sized,
fn to_value(&self) -> Value
fn to_value_type(&self) -> Type
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,