struct _GdkDropPrivate {
GdkDevice *device;
+ GdkDragContext *drag;
GdkContentFormats *formats;
GdkDragAction actions;
};
PROP_ACTIONS,
PROP_DEVICE,
PROP_DISPLAY,
+ PROP_DRAG,
PROP_FORMATS,
N_PROPERTIES
};
g_assert (priv->device != NULL);
break;
+ case PROP_DRAG:
+ priv->drag = g_value_dup_object (value);
+ break;
+
case PROP_FORMATS:
priv->formats = g_value_dup_boxed (value);
#ifdef DROP_SUBCLASS
g_value_set_object (value, gdk_device_get_display (priv->device));
break;
+ case PROP_DRAG:
+ g_value_set_object (value, priv->drag);
+ break;
+
case PROP_FORMATS:
g_value_set_boxed (value, priv->formats);
break;
GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
g_clear_object (&priv->device);
+ g_clear_object (&priv->drag);
G_OBJECT_CLASS (gdk_drop_parent_class)->finalize (object);
}
G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY);
+ /**
+ * GdkDrop:drag:
+ *
+ * The #GdkDrag that initiated this drop
+ */
+ properties[PROP_DRAG] =
+ g_param_spec_object ("drag",
+ "Drag",
+ "The drag that initiated this drop",
+ GDK_TYPE_DRAG_CONTEXT,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS |
+ G_PARAM_EXPLICIT_NOTIFY);
+
/**
* GdkDrop:formats:
*
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ACTIONS]);
}
+/**
+ * gdk_drop_get_drag:
+ * @self: a #GdkDrop
+ *
+ * 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.
+ *
+ * Returns: (transfer none) (nullable): the corresponding #GdkDrag
+ **/
+GdkDragContext *
+gdk_drop_get_drag (GdkDrop *self)
+{
+ GdkDropPrivate *priv = gdk_drop_get_instance_private (self);
+
+ g_return_val_if_fail (GDK_IS_DROP (self), 0);
+
+ return priv->drag;
+}
+
/**
* gdk_drop_status:
* @self: a #GdkDrop