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;
|
|
|
|
|
|
|
|
GdkWindow * (*find_window) (GdkDragContext *context,
|
|
|
|
GdkWindow *drag_window,
|
|
|
|
GdkScreen *screen,
|
|
|
|
gint x_root,
|
|
|
|
gint y_root,
|
|
|
|
GdkDragProtocol *protocol);
|
|
|
|
GdkAtom (*get_selection) (GdkDragContext *context);
|
|
|
|
gboolean (*drag_motion) (GdkDragContext *context,
|
|
|
|
GdkWindow *dest_window,
|
|
|
|
GdkDragProtocol protocol,
|
|
|
|
gint root_x,
|
|
|
|
gint root_y,
|
|
|
|
GdkDragAction suggested_action,
|
|
|
|
GdkDragAction possible_actions,
|
|
|
|
guint32 time_);
|
|
|
|
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_);
|
|
|
|
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
|
|
|
|
|
|
|
gboolean (*manage_dnd) (GdkDragContext *context,
|
|
|
|
GdkWindow *ipc_window,
|
|
|
|
GdkDragAction actions);
|
|
|
|
void (*set_cursor) (GdkDragContext *context,
|
|
|
|
GdkCursor *cursor);
|
|
|
|
void (*cancel) (GdkDragContext *context);
|
|
|
|
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);
|
2010-12-11 05:14:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GdkDragContext {
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2010-12-25 05:02:39 +00:00
|
|
|
/*< private >*/
|
2010-12-11 05:14:53 +00:00
|
|
|
GdkDragProtocol protocol;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
GList *targets;
|
|
|
|
GdkDragAction actions;
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
GdkDragAction action;
|
|
|
|
|
|
|
|
guint32 start_time;
|
|
|
|
|
|
|
|
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
|
|
|
GList * gdk_drag_context_list (void);
|
|
|
|
|
|
|
|
void gdk_drag_context_set_cursor (GdkDragContext *context,
|
|
|
|
GdkCursor *cursor);
|
|
|
|
void gdk_drag_context_cancel (GdkDragContext *context);
|
|
|
|
gboolean gdk_drag_context_handle_source_event (GdkEvent *event);
|
2016-01-13 19:51:19 +00:00
|
|
|
GdkCursor * gdk_drag_get_cursor (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
|
|
|
|
2010-12-11 05:14:53 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif
|