Move some remaining api over

This commit is contained in:
Matthias Clasen 2020-01-02 10:12:44 -05:00
parent aa276a181e
commit 69e3fee5e2
4 changed files with 37 additions and 36 deletions

View File

@ -269,37 +269,6 @@ gtk_drag_get_data (GtkWidget *widget,
data);
}
/**
* gtk_drag_highlight: (method)
* @widget: a widget to highlight
*
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
* GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
void
gtk_drag_highlight (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE, FALSE);
}
/**
* gtk_drag_unhighlight: (method)
* @widget: a widget to remove the highlight from
*
* Removes a highlight set by gtk_drag_highlight() from
* a widget.
*/
void
gtk_drag_unhighlight (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
}
/*
* _gtk_drag_dest_handle_event:
* @toplevel: Toplevel widget that received the event

View File

@ -44,11 +44,6 @@ void gtk_drag_get_data (GtkWidget *widget,
GdkDrop *drop,
GdkAtom target);
GDK_AVAILABLE_IN_ALL
void gtk_drag_highlight (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_drag_unhighlight (GtkWidget *widget);
G_END_DECLS

View File

@ -1057,3 +1057,34 @@ gtk_drop_target_emit_drag_data_received (GtkDropTarget *dest,
set_drop (dest, drop);
g_signal_emit (dest, signals[DRAG_DATA_RECEIVED], 0, sdata);
}
/**
* gtk_drag_highlight: (method)
* @widget: a widget to highlight
*
* Highlights a widget as a currently hovered drop target.
* To end the highlight, call gtk_drag_unhighlight().
*
* GTK calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set.
*/
void
gtk_drag_highlight (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE, FALSE);
}
/**
* gtk_drag_unhighlight: (method)
* @widget: a widget to remove the highlight from
*
* Removes a highlight set by gtk_drag_highlight() from a widget.
*/
void
gtk_drag_unhighlight (GtkWidget *widget)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_DROP_ACTIVE);
}

View File

@ -156,6 +156,12 @@ GtkWidget *gtk_drop_target_get_target (GtkDropTarget *dest);
GDK_AVAILABLE_IN_ALL
const char *gtk_drop_target_find_mimetype (GtkDropTarget *dest);
GDK_AVAILABLE_IN_ALL
void gtk_drag_highlight (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_drag_unhighlight (GtkWidget *widget);
G_END_DECLS