Blame gdk/gdkdnd.c

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