2008-07-01 22:57:50 +00:00
|
|
|
|
/* GDK - The GIMP Drawing Kit
|
2005-07-12 05:09:13 +00:00
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2005-07-12 05:09:13 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
|
* files for a list of changes. These files are distributed with
|
2008-05-28 14:01:57 +00:00
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
2005-07-12 05:09:13 +00:00
|
|
|
|
*/
|
2008-05-28 14:01:57 +00:00
|
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
|
#ifndef __GDK_DND_H__
|
|
|
|
|
#define __GDK_DND_H__
|
|
|
|
|
|
2009-10-21 18:30:04 +00:00
|
|
|
|
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
|
2008-05-28 14:01:57 +00:00
|
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-10-01 23:18:30 +00:00
|
|
|
|
#include <gdk/gdktypes.h>
|
2010-05-25 22:38:44 +00:00
|
|
|
|
#include <gdk/gdkdevice.h>
|
2015-12-07 18:47:45 +00:00
|
|
|
|
#include <gdk/gdkevents.h>
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
2005-06-12 05:32:25 +00:00
|
|
|
|
G_BEGIN_DECLS
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
2010-12-24 20:54:12 +00:00
|
|
|
|
#define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ())
|
|
|
|
|
#define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
|
|
|
|
|
#define GDK_IS_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
2010-06-09 04:33:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* GdkDragAction:
|
|
|
|
|
* @GDK_ACTION_DEFAULT: Means nothing, and should not be used.
|
|
|
|
|
* @GDK_ACTION_COPY: Copy the data.
|
|
|
|
|
* @GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete
|
|
|
|
|
* it from the source using the DELETE target of the X selection protocol.
|
|
|
|
|
* @GDK_ACTION_LINK: Add a link to the data. Note that this is only
|
|
|
|
|
* useful if source and destination agree on what it means.
|
|
|
|
|
* @GDK_ACTION_PRIVATE: Special action which tells the source that the
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* destination will do something that the source doesn’t understand.
|
2010-06-09 04:33:10 +00:00
|
|
|
|
* @GDK_ACTION_ASK: Ask the user what to do with the data.
|
|
|
|
|
*
|
|
|
|
|
* Used in #GdkDragContext to indicate what the destination
|
|
|
|
|
* should do with the dropped data.
|
|
|
|
|
*/
|
2000-04-15 16:22:52 +00:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
1999-10-01 23:18:30 +00:00
|
|
|
|
GDK_ACTION_DEFAULT = 1 << 0,
|
|
|
|
|
GDK_ACTION_COPY = 1 << 1,
|
|
|
|
|
GDK_ACTION_MOVE = 1 << 2,
|
|
|
|
|
GDK_ACTION_LINK = 1 << 3,
|
|
|
|
|
GDK_ACTION_PRIVATE = 1 << 4,
|
|
|
|
|
GDK_ACTION_ASK = 1 << 5
|
|
|
|
|
} GdkDragAction;
|
|
|
|
|
|
2016-02-15 16:02:14 +00:00
|
|
|
|
/**
|
|
|
|
|
* GdkDragCancelReason:
|
|
|
|
|
* @GDK_DRAG_CANCEL_NO_TARGET: There is no suitable drop target.
|
|
|
|
|
* @GDK_DRAG_CANCEL_USER_CANCELLED: Drag cancelled by the user
|
|
|
|
|
* @GDK_DRAG_CANCEL_ERROR: Unspecified error.
|
|
|
|
|
*
|
|
|
|
|
* Used in #GdkDragContext to the reason of a cancelled DND operation.
|
|
|
|
|
*
|
|
|
|
|
* Since: 3.20
|
|
|
|
|
*/
|
|
|
|
|
typedef enum {
|
|
|
|
|
GDK_DRAG_CANCEL_NO_TARGET,
|
|
|
|
|
GDK_DRAG_CANCEL_USER_CANCELLED,
|
|
|
|
|
GDK_DRAG_CANCEL_ERROR
|
|
|
|
|
} GdkDragCancelReason;
|
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-10 06:27:10 +00:00
|
|
|
|
GType gdk_drag_context_get_type (void) G_GNUC_CONST;
|
Deprecate.
* gdk/gdkdrawable.h (gdk_drawable_ref, gdk_drawable_unref),
gdk/gdkcolor.h (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkdnd.h (gdk_drag_context_ref, gdk_drag_context_unref),
gdk/gdkgc.h (gdk_gc_ref, gdk_gc_unref): Deprecate.
* gdk/gdkvisual.h: Use GDK_DISABLE_DEPRECATED, not
GTK_DISABLE_DEPRECATED.
* gdk/gdkcolor.c (gdk_colormap_ref, gdk_colormap_unref),
gdk/gdkgc.c (gdk_gc_ref, gdk_gc_unref): Document.
* gdk/tmpl/colors.sgml, gdk/tmpl/pixmaps.sgml, gdk/tmpl/dnd.sgml,
gdk/tmpl/gcs.sgml: Document ref and unref functions as deprecated.
2001-11-30 22:55:28 +00:00
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-05-25 22:38:44 +00:00
|
|
|
|
void gdk_drag_context_set_device (GdkDragContext *context,
|
|
|
|
|
GdkDevice *device);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDevice * gdk_drag_context_get_device (GdkDragContext *context);
|
|
|
|
|
|
2017-11-18 04:53:25 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_94
|
|
|
|
|
GdkContentFormats *gdk_drag_context_get_formats (GdkDragContext *context);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-05-25 15:54:16 +00:00
|
|
|
|
GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-05-25 15:54:16 +00:00
|
|
|
|
GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-06-02 18:42:11 +00:00
|
|
|
|
GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context);
|
2010-05-25 15:54:16 +00:00
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-06-10 13:52:45 +00:00
|
|
|
|
GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2010-12-10 05:58:33 +00:00
|
|
|
|
GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context);
|
2010-06-10 13:52:45 +00:00
|
|
|
|
|
1999-10-01 23:18:30 +00:00
|
|
|
|
/* Destination side */
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
1999-10-01 23:18:30 +00:00
|
|
|
|
void gdk_drag_status (GdkDragContext *context,
|
2010-12-24 20:54:12 +00:00
|
|
|
|
GdkDragAction action,
|
|
|
|
|
guint32 time_);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
1999-10-01 23:18:30 +00:00
|
|
|
|
void gdk_drop_reply (GdkDragContext *context,
|
2010-12-24 20:54:12 +00:00
|
|
|
|
gboolean accepted,
|
|
|
|
|
guint32 time_);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
1999-10-01 23:18:30 +00:00
|
|
|
|
void gdk_drop_finish (GdkDragContext *context,
|
2010-12-24 20:54:12 +00:00
|
|
|
|
gboolean success,
|
|
|
|
|
guint32 time_);
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
1999-10-01 23:18:30 +00:00
|
|
|
|
GdkAtom gdk_drag_get_selection (GdkDragContext *context);
|
|
|
|
|
|
|
|
|
|
/* Source side */
|
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 04:53:25 +00:00
|
|
|
|
GdkDragContext * gdk_drag_begin (GdkWindow *window,
|
|
|
|
|
GdkContentFormats *formats);
|
2010-12-10 06:27:10 +00:00
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2017-11-18 04:53:25 +00:00
|
|
|
|
GdkDragContext * gdk_drag_begin_for_device (GdkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkContentFormats *formats);
|
2015-12-07 18:47:45 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_20
|
2017-11-18 04:53:25 +00:00
|
|
|
|
GdkDragContext * gdk_drag_begin_from_point (GdkWindow *window,
|
|
|
|
|
GdkDevice *device,
|
|
|
|
|
GdkContentFormats *formats,
|
|
|
|
|
gint x_root,
|
|
|
|
|
gint y_root);
|
2002-04-25 22:29:14 +00:00
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2004-08-06 17:03:52 +00:00
|
|
|
|
gboolean gdk_drag_drop_succeeded (GdkDragContext *context);
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
2015-12-07 20:07:13 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_20
|
|
|
|
|
void gdk_drag_drop_done (GdkDragContext *context,
|
|
|
|
|
gboolean success);
|
|
|
|
|
|
2015-12-02 04:33:53 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_20
|
|
|
|
|
GdkWindow *gdk_drag_context_get_drag_window (GdkDragContext *context);
|
|
|
|
|
|
2015-12-08 02:52:03 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_20
|
|
|
|
|
void gdk_drag_context_set_hotspot (GdkDragContext *context,
|
|
|
|
|
gint hot_x,
|
|
|
|
|
gint hot_y);
|
|
|
|
|
|
gdk: Allow internal management of source-side DnD
We've traditionally left GTK+ to handle the input side of things,
letting GDK only manage the windowing-specific messaging. This
way of splitting responsibilities is not compatible however with
some backends, we must fold then input management at the DnD stage
into GDK (and backends) domain.
The gdk_drag_context_manage_dnd() call is meant to be the entry
point for this mode of operation, if the drag and drop operation
becomes managed, the caller (i.e. gtkdnd.c) doesn't need to perform
grabs, nor manage input events itself.
As a consequence of this, different aspects now belong to the
backend GdkDragContext implementation:
- Because the caller doesn't see keyboard events anymore,
keyboard navigation must be managed in GDK, so is the decision
of the current action based on modifiers/button pressed.
- Because the caller won't see input events in general, the lifetime
of the drag and drop operation is now communicated through the
::drop-performed, ::dnd-finished and ::cancel events
- Because the caller doesn't participate anymore on the action
being chosen, the pointer cursor must be set by the backend.
The caller is rather notified of the final action through the
::action signal.
The caller is still responsible of dealing with the corresponding
GdkSelection, ensuring its ownership and communicating the supported
mimetypes.
2016-01-08 20:03:01 +00:00
|
|
|
|
GDK_AVAILABLE_IN_3_20
|
|
|
|
|
gboolean gdk_drag_context_manage_dnd (GdkDragContext *context,
|
|
|
|
|
GdkWindow *ipc_window,
|
|
|
|
|
GdkDragAction actions);
|
2005-06-12 05:32:25 +00:00
|
|
|
|
G_END_DECLS
|
1999-10-01 23:18:30 +00:00
|
|
|
|
|
2000-06-19 03:00:56 +00:00
|
|
|
|
#endif /* __GDK_DND_H__ */
|