Package ch.bailu.gtk.gtk
Klasse DropTargetAsync
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.EventController
ch.bailu.gtk.gtk.DropTargetAsync
- Alle implementierten Schnittstellen:
PointerInterface
An event controller to receive Drag-and-Drop operations, asynchronously.
It is the more complete but also more complex method of handling drop
operations compared to [class@Gtk.DropTarget], and you should only use
it if `GtkDropTarget` doesn't provide all the features you need.
To use a `GtkDropTargetAsync` to receive drops on a widget, you create
a `GtkDropTargetAsync` object, configure which data formats and actions
you support, connect to its signals, and then attach it to the widget
with [method@Gtk.Widget.add_controller].
During a drag operation, the first signal that a `GtkDropTargetAsync`
emits is [signal@Gtk.DropTargetAsync::accept], which is meant to determine
whether the target is a possible drop site for the ongoing drop. The
default handler for the ::accept signal accepts the drop if it finds
a compatible data format and an action that is supported on both sides.
If it is, and the widget becomes a target, you will receive a
[signal@Gtk.DropTargetAsync::drag-enter] signal, followed by
[signal@Gtk.DropTargetAsync::drag-motion] signals as the pointer moves,
optionally a [signal@Gtk.DropTargetAsync::drop] signal when a drop happens,
and finally a [signal@Gtk.DropTargetAsync::drag-leave] signal when the
pointer moves off the widget.
The ::drag-enter and ::drag-motion handler return a `GdkDragAction`
to update the status of the ongoing operation. The ::drop handler
should decide if it ultimately accepts the drop and if it does, it
should initiate the data transfer and finish the operation by calling
[method@Gdk.Drop.finish].
Between the ::drag-enter and ::drag-leave signals the widget is a
current drop target, and will receive the %GTK_STATE_FLAG_DROP_ACTIVE
state, which can be used by themes to style the widget as a drop target.
It is the more complete but also more complex method of handling drop
operations compared to [class@Gtk.DropTarget], and you should only use
it if `GtkDropTarget` doesn't provide all the features you need.
To use a `GtkDropTargetAsync` to receive drops on a widget, you create
a `GtkDropTargetAsync` object, configure which data formats and actions
you support, connect to its signals, and then attach it to the widget
with [method@Gtk.Widget.add_controller].
During a drag operation, the first signal that a `GtkDropTargetAsync`
emits is [signal@Gtk.DropTargetAsync::accept], which is meant to determine
whether the target is a possible drop site for the ongoing drop. The
default handler for the ::accept signal accepts the drop if it finds
a compatible data format and an action that is supported on both sides.
If it is, and the widget becomes a target, you will receive a
[signal@Gtk.DropTargetAsync::drag-enter] signal, followed by
[signal@Gtk.DropTargetAsync::drag-motion] signals as the pointer moves,
optionally a [signal@Gtk.DropTargetAsync::drop] signal when a drop happens,
and finally a [signal@Gtk.DropTargetAsync::drag-leave] signal when the
pointer moves off the widget.
The ::drag-enter and ::drag-motion handler return a `GdkDragAction`
to update the status of the ongoing operation. The ::drop handler
should decide if it ultimately accepts the drop and if it does, it
should initiate the data transfer and finish the operation by calling
[method@Gdk.Drop.finish].
Between the ::drag-enter and ::drag-leave signals the widget is a
current drop target, and will receive the %GTK_STATE_FLAG_DROP_ACTIVE
state, which can be used by themes to style the widget as a drop target.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
static final String
static final String
static final String
static final String
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDropTargetAsync
(ContentFormats formats, int actions) Creates a new `GtkDropTargetAsync` object.DropTargetAsync
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint
Gets the actions that this drop target supports.static ClassHandler
Gets the data formats that this drop target accepts.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
onAccept
(DropTargetAsync.OnAccept signal) Connect to signal "accept".Connect to signal "drag-enter".Connect to signal "drag-leave".Connect to signal "drag-motion".onDrop
(DropTargetAsync.OnDrop signal) Connect to signal "drop".void
rejectDrop
(Drop drop) Sets the @drop as not accepted on this drag site.void
setActions
(int actions) Sets the actions that this drop target supports.void
setFormats
(ContentFormats formats) Sets the data formats that this drop target will accept.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.EventController
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getName, getPropagationLimit, getPropagationPhase, getWidget, reset, setName, setName, setPropagationLimit, setPropagationPhase, setStaticName, setStaticName
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_ACCEPT
- Siehe auch:
-
SIGNAL_ON_DRAG_ENTER
- Siehe auch:
-
SIGNAL_ON_DRAG_LEAVE
- Siehe auch:
-
SIGNAL_ON_DRAG_MOTION
- Siehe auch:
-
SIGNAL_ON_DROP
- Siehe auch:
-
-
Konstruktordetails
-
DropTargetAsync
-
DropTargetAsync
Creates a new `GtkDropTargetAsync` object.- Parameter:
formats
- the supported data formatsactions
- the supported actions
-
-
Methodendetails
-
getClassHandler
-
getActions
public int getActions()Gets the actions that this drop target supports.- Gibt zurück:
- the actions that this drop target supports
-
getFormats
Gets the data formats that this drop target accepts.
If the result is %NULL, all formats are expected to be supported.- Gibt zurück:
- the supported data formats
-
rejectDrop
Sets the @drop as not accepted on this drag site.
This function should be used when delaying the decision
on whether to accept a drag or not until after reading
the data.- Parameter:
drop
- the `GdkDrop` of an ongoing drag operation
-
setActions
public void setActions(int actions) Sets the actions that this drop target supports.- Parameter:
actions
- the supported actions
-
setFormats
Sets the data formats that this drop target will accept.- Parameter:
formats
- the supported data formats or %NULL for any format
-
onAccept
Connect to signal "accept".
SeeDropTargetAsync.OnAccept.onAccept(ch.bailu.gtk.gdk.Drop)
for signal description.
FieldSIGNAL_ON_ACCEPT
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDragEnter
Connect to signal "drag-enter".
SeeDropTargetAsync.OnDragEnter.onDragEnter(ch.bailu.gtk.gdk.Drop, double, double)
for signal description.
FieldSIGNAL_ON_DRAG_ENTER
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDragLeave
Connect to signal "drag-leave".
SeeDropTargetAsync.OnDragLeave.onDragLeave(ch.bailu.gtk.gdk.Drop)
for signal description.
FieldSIGNAL_ON_DRAG_LEAVE
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDragMotion
Connect to signal "drag-motion".
SeeDropTargetAsync.OnDragMotion.onDragMotion(ch.bailu.gtk.gdk.Drop, double, double)
for signal description.
FieldSIGNAL_ON_DRAG_MOTION
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onDrop
Connect to signal "drop".
SeeDropTargetAsync.OnDrop.onDrop(ch.bailu.gtk.gdk.Drop, double, double)
for signal description.
FieldSIGNAL_ON_DROP
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-