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
|
|
|
*/
|
|
|
|
|
2023-03-31 19:11:10 +00:00
|
|
|
#pragma once
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2018-07-02 11:39:09 +00:00
|
|
|
#include "gdkdrag.h"
|
2010-12-11 05:14:53 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-24 20:54:12 +00:00
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
#define GDK_DRAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG, GdkDragClass))
|
|
|
|
#define GDK_IS_DRAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG))
|
|
|
|
#define GDK_DRAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG, GdkDragClass))
|
2010-12-24 20:54:12 +00:00
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
typedef struct _GdkDragClass GdkDragClass;
|
2010-12-24 20:54:12 +00:00
|
|
|
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
struct _GdkDragClass {
|
2018-06-14 02:58:50 +00:00
|
|
|
GObjectClass parent_class;
|
2010-12-11 05:14:53 +00:00
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
GdkSurface* (*get_drag_surface) (GdkDrag *drag);
|
|
|
|
void (*set_hotspot) (GdkDrag *drag,
|
2020-07-24 13:54:49 +00:00
|
|
|
int hot_x,
|
|
|
|
int hot_y);
|
2018-06-29 17:34:14 +00:00
|
|
|
void (*drop_done) (GdkDrag *drag,
|
2015-12-07 20:07:13 +00:00
|
|
|
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
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
void (*set_cursor) (GdkDrag *drag,
|
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
|
|
|
GdkCursor *cursor);
|
2018-06-29 17:34:14 +00:00
|
|
|
void (*cancel) (GdkDrag *drag,
|
2016-02-15 16:02:14 +00:00
|
|
|
GdkDragCancelReason reason);
|
2018-06-29 17:34:14 +00:00
|
|
|
void (*drop_performed) (GdkDrag *drag,
|
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
|
|
|
guint32 time);
|
2018-06-29 17:34:14 +00:00
|
|
|
void (*dnd_finished) (GdkDrag *drag);
|
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
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
gboolean (*handle_event) (GdkDrag *drag,
|
2020-02-16 16:09:02 +00:00
|
|
|
GdkEvent *event);
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
struct _GdkDrag {
|
2018-06-14 02:58:50 +00:00
|
|
|
GObject parent_instance;
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
2018-06-29 17:34:14 +00:00
|
|
|
void gdk_drag_set_cursor (GdkDrag *drag,
|
|
|
|
GdkCursor *cursor);
|
|
|
|
void gdk_drag_set_actions (GdkDrag *drag,
|
2018-07-04 06:32:27 +00:00
|
|
|
GdkDragAction actions);
|
2018-07-03 22:44:00 +00:00
|
|
|
void gdk_drag_set_selected_action (GdkDrag *drag,
|
2018-07-02 23:16:47 +00:00
|
|
|
GdkDragAction action);
|
2018-06-29 17:34:14 +00:00
|
|
|
|
|
|
|
void gdk_drag_cancel (GdkDrag *drag,
|
|
|
|
GdkDragCancelReason reason);
|
|
|
|
gboolean gdk_drag_handle_source_event (GdkEvent *event);
|
|
|
|
GdkCursor * gdk_drag_get_cursor (GdkDrag *drag,
|
|
|
|
GdkDragAction action);
|
|
|
|
|
|
|
|
void gdk_drag_write_async (GdkDrag *drag,
|
|
|
|
const char *mime_type,
|
|
|
|
GOutputStream *stream,
|
|
|
|
int io_priority,
|
|
|
|
GCancellable *cancellable,
|
|
|
|
GAsyncReadyCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
gboolean gdk_drag_write_finish (GdkDrag *drag,
|
|
|
|
GAsyncResult *result,
|
|
|
|
GError **error);
|
2017-08-24 18:30:47 +00:00
|
|
|
|
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|