Clean up and unify docs and formatting

This commit is contained in:
Matthias Clasen
2014-08-16 16:39:21 -04:00
parent d36bba293d
commit 7bec0939a8

View File

@ -56,14 +56,12 @@
* @Short_description: Functions for controlling drag and drop handling * @Short_description: Functions for controlling drag and drop handling
* @Title: Drag and Drop * @Title: Drag and Drop
* *
* GTK+ has a rich set of functions for doing inter-process * GTK+ has a rich set of functions for doing inter-process communication
* communication via the drag-and-drop metaphor. * via the drag-and-drop metaphor.
* *
* As well as the functions listed here, applications * As well as the functions listed here, applications may need to use some
* may need to use some facilities provided for * facilities provided for [Selections][gtk3-Selections]. Also, the Drag and
* [Selections][gtk3-Selections]. * Drop API makes use of signals in the #GtkWidget class.
* Also, the Drag and Drop API makes use of signals
* in the #GtkWidget class.
*/ */
@ -623,14 +621,12 @@ ungrab_dnd_keys (GtkWidget *widget,
#endif /* GDK_WINDOWING_X11 */ #endif /* GDK_WINDOWING_X11 */
/*************************************************************** /*
* gtk_drag_release_ipc_widget: * gtk_drag_release_ipc_widget:
* Releases widget retrieved with gtk_drag_get_ipc_widget () * @widget: the widget to release
* arguments: *
* widget: the widget to release. * Releases widget retrieved with gtk_drag_get_ipc_widget().
* results: */
***************************************************************/
static void static void
gtk_drag_release_ipc_widget (GtkWidget *widget) gtk_drag_release_ipc_widget (GtkWidget *widget)
{ {
@ -837,10 +833,10 @@ ensure_drag_cursor_pixbuf (int i)
static void static void
get_surface_size (cairo_surface_t *surface, get_surface_size (cairo_surface_t *surface,
int *width, gint *width,
int *height) gint *height)
{ {
double x_scale, y_scale; gdouble x_scale, y_scale;
x_scale = y_scale = 1; x_scale = y_scale = 1;
@ -1103,12 +1099,12 @@ gtk_drag_update_cursor (GtkDragSourceInfo *info)
/** /**
* gtk_drag_get_data: (method) * gtk_drag_get_data: (method)
* @widget: the widget that will receive the * @widget: the widget that will receive the
* #GtkWidget::drag-data-received signal. * #GtkWidget::drag-data-received signal
* @context: the drag context * @context: the drag context
* @target: the target (form of the data) to retrieve. * @target: the target (form of the data) to retrieve
* @time_: a timestamp for retrieving the data. This will * @time_: a timestamp for retrieving the data. This will
* generally be the time received in a #GtkWidget::drag-motion" * generally be the time received in a #GtkWidget::drag-motion"
* or #GtkWidget::drag-drop" signal. * or #GtkWidget::drag-drop" signal
* *
* Gets the data associated with a drag. When the data * Gets the data associated with a drag. When the data
* is received or the retrieval fails, GTK+ will emit a * is received or the retrieval fails, GTK+ will emit a
@ -1146,7 +1142,6 @@ gtk_drag_get_data (GtkWidget *widget,
time_); time_);
} }
/** /**
* gtk_drag_get_source_widget: (method) * gtk_drag_get_source_widget: (method)
* @context: a (destination side) drag context * @context: a (destination side) drag context
@ -1185,11 +1180,11 @@ gtk_drag_get_source_widget (GdkDragContext *context)
/** /**
* gtk_drag_finish: (method) * gtk_drag_finish: (method)
* @context: the drag context. * @context: the drag context
* @success: a flag indicating whether the drop was successful * @success: a flag indicating whether the drop was successful
* @del: a flag indicating whether the source should delete the * @del: a flag indicating whether the source should delete the
* original data. (This should be %TRUE for a move) * original data. (This should be %TRUE for a move)
* @time_: the timestamp from the #GtkWidget::drag-drop signal. * @time_: the timestamp from the #GtkWidget::drag-drop signal
* *
* Informs the drag source that the drop is finished, and * Informs the drag source that the drop is finished, and
* that the data of the drag will no longer be required. * that the data of the drag will no longer be required.
@ -1230,16 +1225,6 @@ gtk_drag_finish (GdkDragContext *context,
gdk_drop_finish (context, success, time); gdk_drop_finish (context, success, time);
} }
/*************************************************************
* gtk_drag_highlight_draw:
* Callback for expose_event for highlighted widgets.
* arguments:
* widget:
* event:
* data:
* results:
*************************************************************/
static gboolean static gboolean
gtk_drag_highlight_draw (GtkWidget *widget, gtk_drag_highlight_draw (GtkWidget *widget,
cairo_t *cr, cairo_t *cr,
@ -1305,7 +1290,7 @@ gtk_drag_highlight (GtkWidget *widget)
/** /**
* gtk_drag_unhighlight: (method) * gtk_drag_unhighlight: (method)
* @widget: a widget to remove the highlight from. * @widget: a widget to remove the highlight from
* *
* Removes a highlight set by gtk_drag_highlight() from * Removes a highlight set by gtk_drag_highlight() from
* a widget. * a widget.
@ -1512,7 +1497,7 @@ gtk_drag_dest_unset (GtkWidget *widget)
* drag-and-drop. * drag-and-drop.
* *
* Returns: (transfer none): the #GtkTargetList, or %NULL if none * Returns: (transfer none): the #GtkTargetList, or %NULL if none
**/ */
GtkTargetList* GtkTargetList*
gtk_drag_dest_get_target_list (GtkWidget *widget) gtk_drag_dest_get_target_list (GtkWidget *widget)
{ {
@ -1533,7 +1518,7 @@ gtk_drag_dest_get_target_list (GtkWidget *widget)
* Sets the target types that this widget can accept from drag-and-drop. * Sets the target types that this widget can accept from drag-and-drop.
* The widget must first be made into a drag destination with * The widget must first be made into a drag destination with
* gtk_drag_dest_set(). * gtk_drag_dest_set().
**/ */
void void
gtk_drag_dest_set_target_list (GtkWidget *widget, gtk_drag_dest_set_target_list (GtkWidget *widget,
GtkTargetList *target_list) GtkTargetList *target_list)
@ -1571,7 +1556,7 @@ gtk_drag_dest_set_target_list (GtkWidget *widget,
* gtk_drag_dest_set_target_list(). * gtk_drag_dest_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_dest_add_text_targets (GtkWidget *widget) gtk_drag_dest_add_text_targets (GtkWidget *widget)
{ {
@ -1598,7 +1583,7 @@ gtk_drag_dest_add_text_targets (GtkWidget *widget)
* gtk_drag_dest_set_target_list(). * gtk_drag_dest_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_dest_add_image_targets (GtkWidget *widget) gtk_drag_dest_add_image_targets (GtkWidget *widget)
{ {
@ -1625,7 +1610,7 @@ gtk_drag_dest_add_image_targets (GtkWidget *widget)
* gtk_drag_dest_set_target_list(). * gtk_drag_dest_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_dest_add_uri_targets (GtkWidget *widget) gtk_drag_dest_add_uri_targets (GtkWidget *widget)
{ {
@ -1654,7 +1639,7 @@ gtk_drag_dest_add_uri_targets (GtkWidget *widget)
* actions regardless of the targets that the source offers. * actions regardless of the targets that the source offers.
* *
* Since: 2.10 * Since: 2.10
**/ */
void void
gtk_drag_dest_set_track_motion (GtkWidget *widget, gtk_drag_dest_set_track_motion (GtkWidget *widget,
gboolean track_motion) gboolean track_motion)
@ -1681,7 +1666,7 @@ gtk_drag_dest_set_track_motion (GtkWidget *widget,
* #GtkWidget::drag-motion events * #GtkWidget::drag-motion events
* *
* Since: 2.10 * Since: 2.10
**/ */
gboolean gboolean
gtk_drag_dest_get_track_motion (GtkWidget *widget) gtk_drag_dest_get_track_motion (GtkWidget *widget)
{ {
@ -1697,17 +1682,14 @@ gtk_drag_dest_get_track_motion (GtkWidget *widget)
return FALSE; return FALSE;
} }
/************************************************************* /*
* _gtk_drag_dest_handle_event: * _gtk_drag_dest_handle_event:
* @toplevel: Toplevel widget that received the event
* @event: the event to handle
*
* Called from widget event handling code on Drag events * Called from widget event handling code on Drag events
* for destinations. * for destinations.
* */
* arguments:
* toplevel: Toplevel widget that received the event
* event:
* results:
*************************************************************/
void void
_gtk_drag_dest_handle_event (GtkWidget *toplevel, _gtk_drag_dest_handle_event (GtkWidget *toplevel,
GdkEvent *event) GdkEvent *event)
@ -1823,7 +1805,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
* *
* Returns: (transfer none): first target that the source offers * Returns: (transfer none): first target that the source offers
* and the dest can accept, or %GDK_NONE * and the dest can accept, or %GDK_NONE
**/ */
GdkAtom GdkAtom
gtk_drag_dest_find_target (GtkWidget *widget, gtk_drag_dest_find_target (GtkWidget *widget,
GdkDragContext *context, GdkDragContext *context,
@ -1962,12 +1944,6 @@ gtk_drag_selection_received (GtkWidget *widget,
gtk_drag_release_ipc_widget (widget); gtk_drag_release_ipc_widget (widget);
} }
/*************************************************************
* gtk_drag_find_widget:
* Function used to locate widgets for
* DRAG_MOTION and DROP_START events.
*************************************************************/
static gboolean static gboolean
gtk_drag_find_widget (GtkWidget *widget, gtk_drag_find_widget (GtkWidget *widget,
GdkDragContext *context, GdkDragContext *context,
@ -2464,7 +2440,7 @@ gtk_drag_source_site_get_icon_helper (GtkDragSourceSite *site)
return helper; return helper;
} }
/* Like GtkDragBegin, but also takes a GtkDragSourceSite, /* Like gtk_drag_begin(), but also takes a GtkDragSourceSite,
* so that we can set the icon from the source site information * so that we can set the icon from the source site information
*/ */
static GdkDragContext * static GdkDragContext *
@ -2668,18 +2644,18 @@ gtk_drag_begin_internal (GtkWidget *widget,
/** /**
* gtk_drag_begin_with_coordinates: (method) * gtk_drag_begin_with_coordinates: (method)
* @widget: the source widget. * @widget: the source widget
* @targets: The targets (data formats) in which the * @targets: The targets (data formats) in which the
* source can provide the data. * source can provide the data
* @actions: A bitmask of the allowed drag actions for this drag. * @actions: A bitmask of the allowed drag actions for this drag
* @button: The button the user clicked to start the drag. * @button: The button the user clicked to start the drag
* @event: The event that triggered the start of the drag. * @event: The event that triggered the start of the drag
* @x: The initial x coordinate to start dragging from, in the coordinate space * @x: The initial x coordinate to start dragging from, in the coordinate space
* of @widget. If -1 is passed, the coordinates are retrieved from @event or * of @widget. If -1 is passed, the coordinates are retrieved from @event or
* the current pointer position. * the current pointer position
* @y: The initial y coordinate to start dragging from, in the coordinate space * @y: The initial y coordinate to start dragging from, in the coordinate space
* of @widget. If -1 is passed, the coordinates are retrieved from @event or * of @widget. If -1 is passed, the coordinates are retrieved from @event or
* the current pointer position. * the current pointer position
* *
* Initiates a drag on the source side. The function only needs to be used * Initiates a drag on the source side. The function only needs to be used
* when the application is starting drags itself, and is not needed when * when the application is starting drags itself, and is not needed when
@ -2707,10 +2683,10 @@ gtk_drag_begin_internal (GtkWidget *widget,
* (remember to free the event with gdk_event_free() when you are done). * (remember to free the event with gdk_event_free() when you are done).
* If you can really not pass a real event, pass #NULL instead. * If you can really not pass a real event, pass #NULL instead.
* *
* Returns: (transfer none): the context for this drag. * Returns: (transfer none): the context for this drag
* *
* Since: 3.10 * Since: 3.10
**/ */
GdkDragContext * GdkDragContext *
gtk_drag_begin_with_coordinates (GtkWidget *widget, gtk_drag_begin_with_coordinates (GtkWidget *widget,
GtkTargetList *targets, GtkTargetList *targets,
@ -2730,20 +2706,20 @@ gtk_drag_begin_with_coordinates (GtkWidget *widget,
/** /**
* gtk_drag_begin: (method) * gtk_drag_begin: (method)
* @widget: the source widget. * @widget: the source widget
* @targets: The targets (data formats) in which the * @targets: The targets (data formats) in which the
* source can provide the data. * source can provide the data
* @actions: A bitmask of the allowed drag actions for this drag. * @actions: A bitmask of the allowed drag actions for this drag
* @button: The button the user clicked to start the drag. * @button: The button the user clicked to start the drag
* @event: The event that triggered the start of the drag. * @event: The event that triggered the start of the drag
* *
* This is equivalent to gtk_drag_begin_with_coordinates(), passing -1, -1 * This function is equivalent to gtk_drag_begin_with_coordinates(),
* as coordinates. * passing -1, -1 as coordinates.
* *
* Returns: (transfer none): the context for this drag. * Returns: (transfer none): the context for this drag
* *
* Deprecated: 3.10: Use gtk_drag_begin_with_coordinates() instead. * Deprecated: 3.10: Use gtk_drag_begin_with_coordinates() instead
**/ */
GdkDragContext * GdkDragContext *
gtk_drag_begin (GtkWidget *widget, gtk_drag_begin (GtkWidget *widget,
GtkTargetList *targets, GtkTargetList *targets,
@ -2763,8 +2739,8 @@ gtk_drag_begin (GtkWidget *widget,
* gtk_drag_source_set: (method) * gtk_drag_source_set: (method)
* @widget: a #GtkWidget * @widget: a #GtkWidget
* @start_button_mask: the bitmask of buttons that can start the drag * @start_button_mask: the bitmask of buttons that can start the drag
* @targets: (allow-none) (array length=n_targets): the table of targets that the drag will support, * @targets: (allow-none) (array length=n_targets): the table of targets
* may be %NULL * that the drag will support, may be %NULL
* @n_targets: the number of items in @targets * @n_targets: the number of items in @targets
* @actions: the bitmask of possible actions for a drag from this widget * @actions: the bitmask of possible actions for a drag from this widget
* *
@ -2858,7 +2834,7 @@ gtk_drag_source_unset (GtkWidget *widget)
* Returns: (transfer none): the #GtkTargetList, or %NULL if none * Returns: (transfer none): the #GtkTargetList, or %NULL if none
* *
* Since: 2.4 * Since: 2.4
**/ */
GtkTargetList * GtkTargetList *
gtk_drag_source_get_target_list (GtkWidget *widget) gtk_drag_source_get_target_list (GtkWidget *widget)
{ {
@ -2881,7 +2857,7 @@ gtk_drag_source_get_target_list (GtkWidget *widget)
* gtk_drag_source_set(). * gtk_drag_source_set().
* *
* Since: 2.4 * Since: 2.4
**/ */
void void
gtk_drag_source_set_target_list (GtkWidget *widget, gtk_drag_source_set_target_list (GtkWidget *widget,
GtkTargetList *target_list) GtkTargetList *target_list)
@ -2918,7 +2894,7 @@ gtk_drag_source_set_target_list (GtkWidget *widget,
* gtk_drag_source_set_target_list(). * gtk_drag_source_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_source_add_text_targets (GtkWidget *widget) gtk_drag_source_add_text_targets (GtkWidget *widget)
{ {
@ -2945,7 +2921,7 @@ gtk_drag_source_add_text_targets (GtkWidget *widget)
* gtk_drag_source_set_target_list(). * gtk_drag_source_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_source_add_image_targets (GtkWidget *widget) gtk_drag_source_add_image_targets (GtkWidget *widget)
{ {
@ -2972,7 +2948,7 @@ gtk_drag_source_add_image_targets (GtkWidget *widget)
* gtk_drag_source_set_target_list(). * gtk_drag_source_set_target_list().
* *
* Since: 2.6 * Since: 2.6
**/ */
void void
gtk_drag_source_add_uri_targets (GtkWidget *widget) gtk_drag_source_add_uri_targets (GtkWidget *widget)
{ {
@ -2996,7 +2972,7 @@ gtk_drag_source_add_uri_targets (GtkWidget *widget)
* Sets the icon that will be used for drags from a particular widget * Sets the icon that will be used for drags from a particular widget
* from a #GdkPixbuf. GTK+ retains a reference for @pixbuf and will * from a #GdkPixbuf. GTK+ retains a reference for @pixbuf and will
* release it when it is no longer needed. * release it when it is no longer needed.
**/ */
void void
gtk_drag_source_set_icon_pixbuf (GtkWidget *widget, gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
GdkPixbuf *pixbuf) GdkPixbuf *pixbuf)
@ -3022,7 +2998,7 @@ gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
* to a stock icon. * to a stock icon.
* *
* Deprecated: 3.10: Use gtk_drag_source_set_icon_name() instead. * Deprecated: 3.10: Use gtk_drag_source_set_icon_name() instead.
**/ */
void void
gtk_drag_source_set_icon_stock (GtkWidget *widget, gtk_drag_source_set_icon_stock (GtkWidget *widget,
const gchar *stock_id) const gchar *stock_id)
@ -3047,7 +3023,7 @@ gtk_drag_source_set_icon_stock (GtkWidget *widget,
* to a themed icon. See the docs for #GtkIconTheme for more details. * to a themed icon. See the docs for #GtkIconTheme for more details.
* *
* Since: 2.8 * Since: 2.8
**/ */
void void
gtk_drag_source_set_icon_name (GtkWidget *widget, gtk_drag_source_set_icon_name (GtkWidget *widget,
const gchar *icon_name) const gchar *icon_name)
@ -3072,7 +3048,7 @@ gtk_drag_source_set_icon_name (GtkWidget *widget,
* to @icon. See the docs for #GtkIconTheme for more details. * to @icon. See the docs for #GtkIconTheme for more details.
* *
* Since: 3.2 * Since: 3.2
**/ */
void void
gtk_drag_source_set_icon_gicon (GtkWidget *widget, gtk_drag_source_set_icon_gicon (GtkWidget *widget,
GIcon *icon) GIcon *icon)
@ -3348,14 +3324,14 @@ set_icon_helper (GdkDragContext *context,
/** /**
* gtk_drag_set_icon_pixbuf: (method) * gtk_drag_set_icon_pixbuf: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
* with a context for the source side of a drag) * with a context for the source side of a drag)
* @pixbuf: the #GdkPixbuf to use as the drag icon. * @pixbuf: the #GdkPixbuf to use as the drag icon
* @hot_x: the X offset within @widget of the hotspot. * @hot_x: the X offset within @widget of the hotspot
* @hot_y: the Y offset within @widget of the hotspot. * @hot_y: the Y offset within @widget of the hotspot
* *
* Sets @pixbuf as the icon for a given drag. * Sets @pixbuf as the icon for a given drag.
**/ */
void void
gtk_drag_set_icon_pixbuf (GdkDragContext *context, gtk_drag_set_icon_pixbuf (GdkDragContext *context,
GdkPixbuf *pixbuf, GdkPixbuf *pixbuf,
@ -3376,16 +3352,16 @@ gtk_drag_set_icon_pixbuf (GdkDragContext *context,
/** /**
* gtk_drag_set_icon_stock: (method) * gtk_drag_set_icon_stock: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
* with a context for the source side of a drag) * with a context for the source side of a drag)
* @stock_id: the ID of the stock icon to use for the drag. * @stock_id: the ID of the stock icon to use for the drag
* @hot_x: the X offset within the icon of the hotspot. * @hot_x: the X offset within the icon of the hotspot
* @hot_y: the Y offset within the icon of the hotspot. * @hot_y: the Y offset within the icon of the hotspot
* *
* Sets the icon for a given drag from a stock ID. * Sets the icon for a given drag from a stock ID.
* *
* Deprecated: 3.10: Use gtk_drag_set_icon_name() instead. * Deprecated: 3.10: Use gtk_drag_set_icon_name() instead.
**/ */
void void
gtk_drag_set_icon_stock (GdkDragContext *context, gtk_drag_set_icon_stock (GdkDragContext *context,
const gchar *stock_id, const gchar *stock_id,
@ -3443,7 +3419,7 @@ _gtk_cairo_surface_extents (cairo_surface_t *surface,
/** /**
* gtk_drag_set_icon_surface: (method) * gtk_drag_set_icon_surface: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
* with a context for the source side of a drag) * with a context for the source side of a drag)
* @surface: the surface to use as icon * @surface: the surface to use as icon
* *
@ -3455,7 +3431,7 @@ _gtk_cairo_surface_extents (cairo_surface_t *surface,
* cairo_surface_set_device_offset() on @surface. The mouse * cairo_surface_set_device_offset() on @surface. The mouse
* cursor will be positioned at the (0,0) coordinate of the * cursor will be positioned at the (0,0) coordinate of the
* surface. * surface.
**/ */
void void
gtk_drag_set_icon_surface (GdkDragContext *context, gtk_drag_set_icon_surface (GdkDragContext *context,
cairo_surface_t *surface) cairo_surface_t *surface)
@ -3544,7 +3520,7 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
/** /**
* gtk_drag_set_icon_name: (method) * gtk_drag_set_icon_name: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
* with a context for the source side of a drag) * with a context for the source side of a drag)
* @icon_name: name of icon to use * @icon_name: name of icon to use
* @hot_x: the X offset of the hotspot within the icon * @hot_x: the X offset of the hotspot within the icon
@ -3557,7 +3533,7 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
* @hot_x and @hot_y have to be used with care. * @hot_x and @hot_y have to be used with care.
* *
* Since: 2.8 * Since: 2.8
**/ */
void void
gtk_drag_set_icon_name (GdkDragContext *context, gtk_drag_set_icon_name (GdkDragContext *context,
const gchar *icon_name, const gchar *icon_name,
@ -3578,18 +3554,18 @@ gtk_drag_set_icon_name (GdkDragContext *context,
/** /**
* gtk_drag_set_icon_gicon: (method) * gtk_drag_set_icon_gicon: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
* with a context for the source side of a drag) * with a context for the source side of a drag)
* @icon: a #GIcon * @icon: a #GIcon
* @hot_x: the X offset of the hotspot within the icon * @hot_x: the X offset of the hotspot within the icon
* @hot_y: the Y offset of the hotspot within the icon * @hot_y: the Y offset of the hotspot within the icon
* *
* Sets the icon for a given drag from the given @icon. See the * Sets the icon for a given drag from the given @icon.
* documentation for gtk_drag_set_icon_name() for more details about * See the documentation for gtk_drag_set_icon_name()
* using icons in drag and drop. * for more details about using icons in drag and drop.
* *
* Since: 3.2 * Since: 3.2
**/ */
void void
gtk_drag_set_icon_gicon (GdkDragContext *context, gtk_drag_set_icon_gicon (GdkDragContext *context,
GIcon *icon, GIcon *icon,
@ -3610,12 +3586,12 @@ gtk_drag_set_icon_gicon (GdkDragContext *context,
/** /**
* gtk_drag_set_icon_default: (method) * gtk_drag_set_icon_default: (method)
* @context: the context for a drag. (This must be called * @context: the context for a drag (This must be called
with a context for the source side of a drag) * with a context for the source side of a drag)
* *
* Sets the icon for a particular drag to the default * Sets the icon for a particular drag to the default
* icon. * icon.
**/ */
void void
gtk_drag_set_icon_default (GdkDragContext *context) gtk_drag_set_icon_default (GdkDragContext *context)
{ {
@ -3624,17 +3600,14 @@ gtk_drag_set_icon_default (GdkDragContext *context)
gtk_drag_set_icon_name (context, "text-x-generic", -2, -2); gtk_drag_set_icon_name (context, "text-x-generic", -2, -2);
} }
/************************************************************* /*
* _gtk_drag_source_handle_event: * _gtk_drag_source_handle_event:
* @toplevel: Toplevel widget that received the event
* @event: the event to handle
*
* Called from widget event handling code on Drag events * Called from widget event handling code on Drag events
* for drag sources. * for drag sources.
* */
* arguments:
* toplevel: Toplevel widget that received the event
* event:
* results:
*************************************************************/
void void
_gtk_drag_source_handle_event (GtkWidget *widget, _gtk_drag_source_handle_event (GtkWidget *widget,
GdkEvent *event) GdkEvent *event)
@ -3710,15 +3683,6 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
} }
} }
/*************************************************************
* gtk_drag_source_check_selection:
* Check if weve set up handlers/claimed the selection
* for a given drag. If not, add them.
* arguments:
*
* results:
*************************************************************/
static void static void
gtk_drag_source_check_selection (GtkDragSourceInfo *info, gtk_drag_source_check_selection (GtkDragSourceInfo *info,
GdkAtom selection, GdkAtom selection,
@ -3759,16 +3723,8 @@ gtk_drag_source_check_selection (GtkDragSourceInfo *info,
TARGET_DELETE); TARGET_DELETE);
} }
/*************************************************************
* gtk_drag_drop_finished:
* Clean up from the drag, and display snapback, if necessary.
* arguments:
* info:
* success:
* time:
* results:
*************************************************************/
/* Clean up from the drag, and display snapback, if necessary. */
static void static void
gtk_drag_drop_finished (GtkDragSourceInfo *info, gtk_drag_drop_finished (GtkDragSourceInfo *info,
GtkDragResult result, GtkDragResult result,
@ -3839,14 +3795,6 @@ gtk_drag_source_release_selections (GtkDragSourceInfo *info,
info->selections = NULL; info->selections = NULL;
} }
/*************************************************************
* gtk_drag_drop:
* Send a drop event.
* arguments:
*
* results:
*************************************************************/
static void static void
gtk_drag_drop (GtkDragSourceInfo *info, gtk_drag_drop (GtkDragSourceInfo *info,
guint32 time) guint32 time)
@ -4197,7 +4145,7 @@ gtk_drag_add_update_idle (GtkDragSourceInfo *info)
} }
} }
/** /*
* gtk_drag_update: * gtk_drag_update:
* @info: DragSourceInfo for the drag * @info: DragSourceInfo for the drag
* @screen: new screen * @screen: new screen
@ -4207,7 +4155,7 @@ gtk_drag_add_update_idle (GtkDragSourceInfo *info)
* *
* Updates the status of the drag; called when the * Updates the status of the drag; called when the
* cursor moves or the modifier changes * cursor moves or the modifier changes
**/ */
static void static void
gtk_drag_update (GtkDragSourceInfo *info, gtk_drag_update (GtkDragSourceInfo *info,
GdkScreen *screen, GdkScreen *screen,
@ -4229,18 +4177,12 @@ gtk_drag_update (GtkDragSourceInfo *info,
gtk_drag_add_update_idle (info); gtk_drag_add_update_idle (info);
} }
/************************************************************* /* Called when the user finishes to drag, either by
* gtk_drag_end:
* Called when the user finishes to drag, either by
* releasing the mouse, or by pressing Esc. * releasing the mouse, or by pressing Esc.
* arguments: */
* info: Source info for the drag
* time: Timestamp for ending the drag
* results:
*************************************************************/
static void static void
gtk_drag_end (GtkDragSourceInfo *info, guint32 time) gtk_drag_end (GtkDragSourceInfo *info,
guint32 time)
{ {
GtkWidget *source_widget = info->widget; GtkWidget *source_widget = info->widget;
GdkDevice *pointer, *keyboard; GdkDevice *pointer, *keyboard;
@ -4314,32 +4256,20 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
} }
} }
/************************************************************* /* Called on cancellation of a drag, either by the user
* gtk_drag_cancel:
* Called on cancellation of a drag, either by the user
* or programmatically. * or programmatically.
* arguments: */
* info: Source info for the drag
* time: Timestamp for ending the drag
* results:
*************************************************************/
static void static void
gtk_drag_cancel (GtkDragSourceInfo *info, GtkDragResult result, guint32 time) gtk_drag_cancel (GtkDragSourceInfo *info,
GtkDragResult result,
guint32 time)
{ {
gtk_drag_end (info, time); gtk_drag_end (info, time);
gdk_drag_abort (info->context, time); gdk_drag_abort (info->context, time);
gtk_drag_drop_finished (info, result, time); gtk_drag_drop_finished (info, result, time);
} }
/************************************************************* /* “motion-notify-event” callback during drag. */
* gtk_drag_motion_cb:
* “motion-notify-event” callback during drag.
* arguments:
*
* results:
*************************************************************/
static gboolean static gboolean
gtk_drag_motion_cb (GtkWidget *widget, gtk_drag_motion_cb (GtkWidget *widget,
GdkEventMotion *event, GdkEventMotion *event,
@ -4365,17 +4295,10 @@ gtk_drag_motion_cb (GtkWidget *widget,
return TRUE; return TRUE;
} }
/*************************************************************
* gtk_drag_key_cb:
* “key-press/release-event” callback during drag.
* arguments:
*
* results:
*************************************************************/
#define BIG_STEP 20 #define BIG_STEP 20
#define SMALL_STEP 1 #define SMALL_STEP 1
/* “key-press/release-event” callback during drag */
static gboolean static gboolean
gtk_drag_key_cb (GtkWidget *widget, gtk_drag_key_cb (GtkWidget *widget,
GdkEventKey *event, GdkEventKey *event,
@ -4503,15 +4426,7 @@ gtk_drag_grab_notify_cb (GtkWidget *widget,
} }
} }
/* “button-release-event” callback during drag */
/*************************************************************
* gtk_drag_button_release_cb:
* “button-release-event” callback during drag.
* arguments:
*
* results:
*************************************************************/
static gboolean static gboolean
gtk_drag_button_release_cb (GtkWidget *widget, gtk_drag_button_release_cb (GtkWidget *widget,
GdkEventButton *event, GdkEventButton *event,
@ -4564,7 +4479,7 @@ gtk_drag_abort_timeout (gpointer data)
* should trigger the beginning of a drag-and-drop operation. * should trigger the beginning of a drag-and-drop operation.
* *
* Returns: %TRUE if the drag threshold has been passed. * Returns: %TRUE if the drag threshold has been passed.
**/ */
gboolean gboolean
gtk_drag_check_threshold (GtkWidget *widget, gtk_drag_check_threshold (GtkWidget *widget,
gint start_x, gint start_x,