2010-12-11 05:14:53 +00:00
|
|
|
/* GDK - The GIMP Drawing Kit
|
|
|
|
* Copyright (C) 2010, Red Hat, Inc
|
|
|
|
*
|
|
|
|
* 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/>.
|
2010-12-11 05:14:53 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GDK_DND_PRIVATE_H__
|
|
|
|
#define __GDK_DND_PRIVATE_H__
|
|
|
|
|
|
|
|
#include "gdkdnd.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-24 20:54:12 +00:00
|
|
|
|
|
|
|
#define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
|
|
|
|
#define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
|
|
|
|
#define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
|
|
|
|
|
|
|
|
typedef struct _GdkDragContextClass GdkDragContextClass;
|
|
|
|
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
struct _GdkDragContextClass {
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
|
|
|
void (*drag_status) (GdkDragContext *context,
|
|
|
|
GdkDragAction action,
|
|
|
|
guint32 time_);
|
|
|
|
void (*drag_abort) (GdkDragContext *context,
|
|
|
|
guint32 time_);
|
|
|
|
void (*drag_drop) (GdkDragContext *context,
|
|
|
|
guint32 time_);
|
|
|
|
void (*drop_reply) (GdkDragContext *context,
|
|
|
|
gboolean accept,
|
|
|
|
guint32 time_);
|
|
|
|
void (*drop_finish) (GdkDragContext *context,
|
|
|
|
gboolean success,
|
|
|
|
guint32 time_);
|
2017-12-10 00:05:37 +00:00
|
|
|
void (* read_async) (GdkDragContext *context,
|
|
|
|
GdkContentFormats *formats,
|
|
|
|
int io_priority,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
GInputStream * (* read_finish) (GdkDragContext *context,
|
|
|
|
const char **out_mime_type,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
2010-12-11 05:14:53 +00:00
|
|
|
gboolean (*drop_status) (GdkDragContext *context);
|
2015-12-02 04:33:53 +00:00
|
|
|
GdkWindow* (*get_drag_window) (GdkDragContext *context);
|
2015-12-08 02:52:03 +00:00
|
|
|
void (*set_hotspot) (GdkDragContext *context,
|
|
|
|
gint hot_x,
|
|
|
|
gint hot_y);
|
2015-12-07 20:07:13 +00:00
|
|
|
void (*drop_done) (GdkDragContext *context,
|
|
|
|
gboolean success);
|
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
|
|
|
|
|
|
|
void (*set_cursor) (GdkDragContext *context,
|
|
|
|
GdkCursor *cursor);
|
2016-02-15 16:02:14 +00:00
|
|
|
void (*cancel) (GdkDragContext *context,
|
|
|
|
GdkDragCancelReason reason);
|
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
|
|
|
void (*drop_performed) (GdkDragContext *context,
|
|
|
|
guint32 time);
|
|
|
|
void (*dnd_finished) (GdkDragContext *context);
|
|
|
|
|
|
|
|
gboolean (*handle_event) (GdkDragContext *context,
|
|
|
|
const GdkEvent *event);
|
|
|
|
void (*action_changed) (GdkDragContext *context,
|
|
|
|
GdkDragAction action);
|
2016-03-09 16:00:31 +00:00
|
|
|
|
|
|
|
void (*commit_drag_status) (GdkDragContext *context);
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDragContext {
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2010-12-25 05:02:39 +00:00
|
|
|
/*< private >*/
|
2016-04-26 07:31:33 +00:00
|
|
|
GdkDisplay *display;
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
gboolean is_source;
|
|
|
|
GdkWindow *source_window;
|
|
|
|
GdkWindow *dest_window;
|
2015-12-02 04:33:53 +00:00
|
|
|
GdkWindow *drag_window;
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2017-12-13 14:03:53 +00:00
|
|
|
GdkContentProvider *content;
|
2017-11-18 04:53:25 +00:00
|
|
|
GdkContentFormats *formats;
|
2010-12-11 05:14:53 +00:00
|
|
|
GdkDragAction actions;
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
GdkDragAction action;
|
|
|
|
|
|
|
|
GdkDevice *device;
|
2016-02-15 17:56:42 +00:00
|
|
|
|
|
|
|
guint drop_done : 1; /* Whether gdk_drag_drop_done() was performed */
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
2017-12-10 23:17:36 +00:00
|
|
|
void gdk_drag_context_set_device (GdkDragContext *context,
|
|
|
|
GdkDevice *device);
|
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
|
|
|
void gdk_drag_context_set_cursor (GdkDragContext *context,
|
|
|
|
GdkCursor *cursor);
|
2016-02-15 16:02:14 +00:00
|
|
|
void gdk_drag_context_cancel (GdkDragContext *context,
|
|
|
|
GdkDragCancelReason reason);
|
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
|
|
|
gboolean gdk_drag_context_handle_source_event (GdkEvent *event);
|
2016-03-09 16:00:31 +00:00
|
|
|
gboolean gdk_drag_context_handle_dest_event (GdkEvent *event);
|
2016-04-26 07:31:33 +00:00
|
|
|
GdkCursor * gdk_drag_get_cursor (GdkDragContext *context,
|
|
|
|
GdkDragAction action);
|
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
|
|
|
|
2017-08-24 18:30:47 +00:00
|
|
|
void gdk_drag_abort (GdkDragContext *context,
|
|
|
|
guint32 time_);
|
|
|
|
void gdk_drag_drop (GdkDragContext *context,
|
|
|
|
guint32 time_);
|
|
|
|
|
2017-12-13 14:03:53 +00:00
|
|
|
void gdk_drag_context_write_async (GdkDragContext *context,
|
|
|
|
const char *mime_type,
|
|
|
|
GOutputStream *stream,
|
|
|
|
int io_priority,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
gboolean gdk_drag_context_write_finish (GdkDragContext *context,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
2017-08-24 18:30:47 +00:00
|
|
|
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif
|