Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Drop

[23:7] extends: object

Represents the target of an ongoing DND operation. Possible drop sites get informed about the status of the ongoing drag operation with events of type GDK_DRAG_ENTER, GDK_DRAG_LEAVE, GDK_DRAG_MOTION and GDK_DROP_START. The GdkDrop object can be obtained from these [class@Gdk.Event] types using [method@Gdk.DNDEvent.get_drop]. The actual data transfer is initiated from the target side via an async read, using one of the GdkDrop methods for this purpose: [method@Gdk.Drop.read_async] or [method@Gdk.Drop.read_value_async]. 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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Drop (Handle = null)

    Creates a new Drop by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • 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.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • finish (string action)

    Ends the drag operation after a drop. The @action must be a single action selected from the actions available via [method@Gdk.Drop.get_actions].

    • @p action is the action performed by the destination or GDK_ACTION_NONE if the drop failed.
    • @r None.
  • get_actions ()

    Returns the possible actions for this GdkDrop. If this value contains multiple actions - i.e. [func@Gdk.DragAction.is_unique] returns false for the result - [method@Gdk.Drop.finish] must choose the action to use when accepting the drop. This will only happen if you passed GDK_ACTION_ASK as one of the possible actions in [method@Gdk.Drop.status]. GDK_ACTION_ASK itself will not be included in the actions returned by this function. This value may change over the lifetime of the [class@Gdk.Drop] both as a response to source side actions as well as to calls to [method@Gdk.Drop.status] or [method@Gdk.Drop.finish]. The source side will not change this value anymore once a drop has started.

  • get_device ()

    Returns the GdkDevice performing the drop.

  • get_display ()

    Gets the GdkDisplay that @self was created for.

  • get_drag ()

    If this is an in-app drag-and-drop operation, returns the GdkDrag that corresponds to this drop. If it is not, NULL is returned.

  • get_formats ()

    Returns the GdkContentFormats that the drop offers the data to be read in.

  • get_surface ()

    Returns the GdkSurface performing the drop.

  • read_value_finish (object result)

    Finishes an async drop read. See [method@Gdk.Drop.read_value_async].

    • @p result is a GAsyncResult.
  • status (string actions, string preferred)

    Selects all actions that are potentially supported by the destination. When calling this function, do not restrict the passed in actions to the ones provided by [method@Gdk.Drop.get_actions]. Those actions may change in the future, even depending on the actions you provide here. The

    • @preferred action is a hint to the drag-and-drop mechanism about which action to use when multiple actions are possible. This function should be called by drag destinations in response to GDK_DRAG_ENTER or GDK_DRAG_MOTION events. If the destination does not yet know the exact actions it supports, it should set any possible actions first and then later call this function again.
    • @p actions is Supported actions of the destination, or GDK_ACTION_NONE to indicate that a drop will not be accepted.
    • @p preferred is A unique action that's a member of @actions indicating the preferred action.
    • @r None.

class: DropMeta

[226:14] static extends: object

Generated metadata helpers for Drop class surfaces.

Methods

  • properties ()

    Returns property metadata for Drop.

    • @r A list.