Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DropTargetAsyncAcceptCallback

[380:7] extends: object

Generated low-level callback wrapper for GIR callback accept.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DropTargetAsyncAcceptCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, drop, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DropTargetAsyncMeta

[735:14] static extends: object

Generated metadata helpers for DropTargetAsync class surfaces.

Methods

  • properties ()

    Returns property metadata for DropTargetAsync.

    • @r A list.
  • signals ()

    Returns signal metadata for DropTargetAsync.

    • @r A list.

class: DropTargetAsync

[37:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • DropTargetAsync (formats = null, actions = null)

    Creates a new GtkDropTargetAsync object.

    • @p formats is the supported data formats.
    • @p actions is the supported actions.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asEventController ()

    Wraps this handle as EventController.

    • @r A EventController object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnAccept (callback Fn, UserData = null)

    Emitted on the drop site when a drop operation is about to begin. If the drop is not accepted, %FALSE will be returned and the drop target will ignore the drop. If %TRUE is returned, the drop is accepted for now but may be rejected later via a call to [method@Gtk.DropTargetAsync.reject_drop] or ultimately by returning %FALSE from a [signal@Gtk.DropTargetAsync::drop] handler. The default handler for this signal decides whether to accept the drop based on the formats provided by the @drop. If the decision whether the drop will be accepted or rejected needs further processing, such as inspecting the data, this function should return %TRUE and proceed as is @drop was accepted and if it decides to reject the drop later, it should call [method@Gtk.DropTargetAsync.reject_drop].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (DropTargetAsync Self, Drop Drop).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDragenter (callback Fn, UserData = null)

    Emitted on the drop site when the pointer enters the widget. It can be used to set up custom highlighting.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (DropTargetAsync Self, Drop Drop, double X, double Y).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDragleave (callback Fn, UserData = null)

    Emitted on the drop site when the pointer leaves the widget. Its main purpose it to undo things done in GtkDropTargetAsync::drag-enter.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (DropTargetAsync Self, Drop Drop).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDragmotion (callback Fn, UserData = null)

    Emitted while the pointer is moving over the drop target.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (DropTargetAsync Self, Drop Drop, double X, double Y).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDrop (callback Fn, UserData = null)

    Emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the pointer position is in a drop zone or not. If it is not in a drop zone, it returns %FALSE and no further processing is necessary. Otherwise, the handler returns %TRUE. In this case, this handler will accept the drop. The handler must ensure that [method@Gdk.Drop.finish] is called to let the source know that the drop is done. The call to [method@Gdk.Drop.finish] must only be done when all data has been received. To receive the data, use one of the read functions provided by [class@Gdk.Drop] such as [method@Gdk.Drop.read_async] or [method@Gdk.Drop.read_value_async].

    • @p Fn is the Aussom callback.
    • @p Fn is called with (DropTargetAsync Self, Drop Drop, double X, double Y).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setActions (string Value)

    The GdkDragActions that this drop target supports.

    • @p Value is the new property value.
    • @r None.
  • setFormats (object Value)

    The GdkContentFormats that determines the supported data formats.

    • @p Value is the new property value.
    • @r None.
  • get_actions ()

    Gets the actions that this drop target supports.

  • get_formats ()

    Gets the data formats that this drop target accepts. If the result is %NULL, all formats are expected to be supported.

  • reject_drop (object drop)

    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.

    • @p drop is the GdkDrop of an ongoing drag operation.
    • @r None.
  • set_actions (string actions)

    Sets the actions that this drop target supports.

    • @p actions is the supported actions.
    • @r None.
  • set_formats (object formats)

    Sets the data formats that this drop target will accept.

    • @p formats is the supported data formats or %NULL for any format.
    • @r None.

class: DropTargetAsyncDragenterCallback

[451:7] extends: object

Generated low-level callback wrapper for GIR callback drag-enter.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DropTargetAsyncDragenterCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, drop, x, y, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DropTargetAsyncDragleaveCallback

[522:7] extends: object

Generated low-level callback wrapper for GIR callback drag-leave.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DropTargetAsyncDragleaveCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, drop, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DropTargetAsyncDragmotionCallback

[593:7] extends: object

Generated low-level callback wrapper for GIR callback drag-motion.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DropTargetAsyncDragmotionCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, drop, x, y, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DropTargetAsyncDropCallback

[664:7] extends: object

Generated low-level callback wrapper for GIR callback drop.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DropTargetAsyncDropCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, drop, x, y, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.