|
Packit Service |
fb6fa5 |
/* GDK - The GIMP Drawing Kit
|
|
Packit Service |
fb6fa5 |
* Copyright (C) 1995-1999 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
fb6fa5 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
fb6fa5 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
fb6fa5 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
fb6fa5 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
fb6fa5 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
fb6fa5 |
* Lesser General Public License for more details.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
fb6fa5 |
* License along with this library; if not, write to the
|
|
Packit Service |
fb6fa5 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Packit Service |
fb6fa5 |
* Boston, MA 02111-1307, USA.
|
|
Packit Service |
fb6fa5 |
*/
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/*
|
|
Packit Service |
fb6fa5 |
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
Packit Service |
fb6fa5 |
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
Packit Service |
fb6fa5 |
* files for a list of changes. These files are distributed with
|
|
Packit Service |
fb6fa5 |
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
Packit Service |
fb6fa5 |
*/
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
#include "config.h"
|
|
Packit Service |
fb6fa5 |
#include <gdkdnd.h>
|
|
Packit Service |
fb6fa5 |
#include <gdkdrawable.h>
|
|
Packit Service |
fb6fa5 |
#include <gdkdisplay.h>
|
|
Packit Service |
fb6fa5 |
#include "gdkalias.h"
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_find_window:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext.
|
|
Packit Service |
fb6fa5 |
* @drag_window: a window which may be at the pointer position, but
|
|
Packit Service |
fb6fa5 |
* should be ignored, since it is put up by the drag source as an icon.
|
|
Packit Service |
fb6fa5 |
* @x_root: the x position of the pointer in root coordinates.
|
|
Packit Service |
fb6fa5 |
* @y_root: the y position of the pointer in root coordinates.
|
|
Packit Service |
fb6fa5 |
* @dest_window: (out): location to store the destination window in.
|
|
Packit Service |
fb6fa5 |
* @protocol: (out): location to store the DND protocol in.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Finds the destination window and DND protocol to use at the
|
|
Packit Service |
fb6fa5 |
* given pointer position.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* This function is called by the drag source to obtain the
|
|
Packit Service |
fb6fa5 |
* @dest_window and @protocol parameters for gdk_drag_motion().
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Deprecated: 2.24: Use gdk_drag_find_window_for_screen() instead.
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
void
|
|
Packit Service |
fb6fa5 |
gdk_drag_find_window (GdkDragContext *context,
|
|
Packit Service |
fb6fa5 |
GdkWindow *drag_window,
|
|
Packit Service |
fb6fa5 |
gint x_root,
|
|
Packit Service |
fb6fa5 |
gint y_root,
|
|
Packit Service |
fb6fa5 |
GdkWindow **dest_window,
|
|
Packit Service |
fb6fa5 |
GdkDragProtocol *protocol)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
gdk_drag_find_window_for_screen (context, drag_window,
|
|
Packit Service |
fb6fa5 |
gdk_drawable_get_screen (context->source_window),
|
|
Packit Service |
fb6fa5 |
x_root, y_root, dest_window, protocol);
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_get_protocol:
|
|
Packit Service |
fb6fa5 |
* @xid: the windowing system id of the destination window.
|
|
Packit Service |
fb6fa5 |
* @protocol: location where the supported DND protocol is returned.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Finds out the DND protocol supported by a window.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: the windowing system specific id for the window where
|
|
Packit Service |
fb6fa5 |
* the drop should happen. This may be @xid or the id of a proxy
|
|
Packit Service |
fb6fa5 |
* window, or zero if @xid doesn't support Drag and Drop.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Deprecated: 2.24: Use gdk_drag_get_protocol_for_display() instead
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GdkNativeWindow
|
|
Packit Service |
fb6fa5 |
gdk_drag_get_protocol (GdkNativeWindow xid,
|
|
Packit Service |
fb6fa5 |
GdkDragProtocol *protocol)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol);
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_list_targets:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Retrieves the list of targets of the context.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: (transfer none) (element-type GdkAtom): a #GList of targets
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.22
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GList *
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_list_targets (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->targets;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_actions:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Determines the bitmask of actions proposed by the source if
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_suggested_action() returns GDK_ACTION_ASK.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: the #GdkDragAction flags
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.22
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GdkDragAction
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_actions (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_ACTION_DEFAULT);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->actions;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_suggested_action:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Determines the suggested drag action of the context.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: a #GdkDragAction value
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.22
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GdkDragAction
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_suggested_action (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->suggested_action;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_selected_action:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Determines the action chosen by the drag destination.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: a #GdkDragAction value
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.22
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GdkDragAction
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_selected_action (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->action;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_source_window:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Returns the #GdkWindow where the DND operation started.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: (transfer none): a #GdkWindow
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.22
|
|
Packit Service |
fb6fa5 |
**/
|
|
Packit Service |
fb6fa5 |
GdkWindow *
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_source_window (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->source_window;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_dest_window:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Returns the destination windw for the DND operation.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Return value: (transfer none): a #GdkWindow
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.24
|
|
Packit Service |
fb6fa5 |
*/
|
|
Packit Service |
fb6fa5 |
GdkWindow *
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_dest_window (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->dest_window;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
/**
|
|
Packit Service |
fb6fa5 |
* gdk_drag_context_get_protocol:
|
|
Packit Service |
fb6fa5 |
* @context: a #GdkDragContext
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Returns the drag protocol thats used by this context.
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Returns: the drag protocol
|
|
Packit Service |
fb6fa5 |
*
|
|
Packit Service |
fb6fa5 |
* Since: 2.24
|
|
Packit Service |
fb6fa5 |
*/
|
|
Packit Service |
fb6fa5 |
GdkDragProtocol
|
|
Packit Service |
fb6fa5 |
gdk_drag_context_get_protocol (GdkDragContext *context)
|
|
Packit Service |
fb6fa5 |
{
|
|
Packit Service |
fb6fa5 |
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_DRAG_PROTO_NONE);
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
return context->protocol;
|
|
Packit Service |
fb6fa5 |
}
|
|
Packit Service |
fb6fa5 |
|
|
Packit Service |
fb6fa5 |
#define __GDK_DND_C__
|
|
Packit Service |
fb6fa5 |
#include "gdkaliasdef.c"
|