Package ch.bailu.gtk.gdk
Klasse Drag
- Alle implementierten Schnittstellen:
PointerInterface
Represents the source of an ongoing DND operation.
A `GdkDrag` is created when a drag is started, and stays alive for duration of
the DND operation. After a drag has been started with [func@Gdk.Drag.begin],
the caller gets informed about the status of the ongoing drag operation
with signals on the `GdkDrag` object.
GTK provides a higher level abstraction based on top of these functions,
and so they are not normally needed in GTK applications. See the
"Drag and Drop" section of the GTK documentation for more information.
A `GdkDrag` is created when a drag is started, and stays alive for duration of
the DND operation. After a drag has been started with [func@Gdk.Drag.begin],
the caller gets informed about the status of the ongoing drag operation
with signals on the `GdkDrag` object.
GTK provides a higher level abstraction based on top of these functions,
and so they are not normally needed in GTK applications. See the
"Drag and Drop" section of the GTK documentation for more information.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic 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
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Drag
begin
(Surface surface, Device device, ContentProvider content, int actions, double dx, double dy) Starts a drag and creates a new drag context for it.void
dropDone
(boolean success) Informs GDK that the drop ended.int
Determines the bitmask of possible actions proposed by the source.static ClassHandler
Returns the `GdkContentProvider` associated to the `GdkDrag` object.Returns the `GdkDevice` associated to the `GdkDrag` object.Gets the `GdkDisplay` that the drag object was created for.Returns the surface on which the drag icon should be rendered
during the drag operation.Retrieves the formats supported by this `GdkDrag` object.static int
static long
static TypeSystem.TypeSize
int
Determines the action chosen by the drag destination.Returns the `GdkSurface` where the drag originates.static long
static TypeSystem.TypeSize
onCancel
(Drag.OnCancel signal) Connect to signal "cancel".onDndFinished
(Drag.OnDndFinished signal) Connect to signal "dnd-finished".onDropPerformed
(Drag.OnDropPerformed signal) Connect to signal "drop-performed".void
setHotspot
(int hot_x, int hot_y) Sets the position of the drag surface that will be kept
under the cursor hotspot.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_CANCEL
- Siehe auch:
-
SIGNAL_ON_DND_FINISHED
- Siehe auch:
-
SIGNAL_ON_DROP_PERFORMED
- Siehe auch:
-
-
Konstruktordetails
-
Drag
-
-
Methodendetails
-
getClassHandler
-
dropDone
public void dropDone(boolean success) 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 @drag.
The `GdkDrag` will only take the first [method@Gdk.Drag.drop_done]
call as effective, if this function is called multiple times,
all subsequent calls will be ignored.- Parameter:
success
- whether the drag was ultimatively successful
-
getActions
public int getActions()Determines the bitmask of possible actions proposed by the source.- Gibt zurück:
- the `GdkDragAction` flags
-
getContent
Returns the `GdkContentProvider` associated to the `GdkDrag` object.- Gibt zurück:
- The `GdkContentProvider` associated to @drag.
-
getDevice
Returns the `GdkDevice` associated to the `GdkDrag` object.- Gibt zurück:
- The `GdkDevice` associated to @drag.
-
getDisplay
Gets the `GdkDisplay` that the drag object was created for.- Gibt zurück:
- a `GdkDisplay`
-
getDragSurface
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 @drag and will be destroyed
when the drag operation is over.- Gibt zurück:
- the drag surface
-
getFormats
Retrieves the formats supported by this `GdkDrag` object.- Gibt zurück:
- a `GdkContentFormats`
-
getSelectedAction
public int getSelectedAction()Determines the action chosen by the drag destination.- Gibt zurück:
- a `GdkDragAction` value
-
getSurface
Returns the `GdkSurface` where the drag originates.- Gibt zurück:
- The `GdkSurface` where the drag originates
-
setHotspot
public void setHotspot(int hot_x, int hot_y) 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.- Parameter:
hot_x
- x coordinate of the drag surface hotspothot_y
- y coordinate of the drag surface hotspot
-
onCancel
Connect to signal "cancel".
SeeDrag.OnCancel.onCancel(int)
for signal description.
FieldSIGNAL_ON_CANCEL
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.
-
onDndFinished
Connect to signal "dnd-finished".
SeeDrag.OnDndFinished.onDndFinished()
for signal description.
FieldSIGNAL_ON_DND_FINISHED
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.
-
onDropPerformed
Connect to signal "drop-performed".
SeeDrag.OnDropPerformed.onDropPerformed()
for signal description.
FieldSIGNAL_ON_DROP_PERFORMED
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.
-
begin
public static Drag begin(@Nonnull Surface surface, @Nonnull Device device, @Nonnull ContentProvider content, int actions, double dx, double dy) Starts a drag and creates a new drag context for it.
This function is called by the drag source. After this call, you
probably want to set up the drag icon using the surface returned
by [method@Gdk.Drag.get_drag_surface].
This function returns a reference to the [class@Gdk.Drag] object,
but GTK keeps its own reference as well, as long as the DND operation
is going on.
Note: if @actions include %GDK_ACTION_MOVE, you need to listen for
the [signal@Gdk.Drag::dnd-finished] signal and delete the data at
the source if [method@Gdk.Drag.get_selected_action] returns
%GDK_ACTION_MOVE.- Parameter:
surface
- the source surface for this dragdevice
- the device that controls this dragcontent
- the offered contentactions
- the actions supported by this dragdx
- the x offset to @device's position where the drag nominally starteddy
- the y offset to @device's position where the drag nominally started- Gibt zurück:
- a newly created `GdkDrag`
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-