overlay: add setters and getters for pass-through child property

This will make the API easier to use from bindings too.

https://bugzilla.gnome.org/show_bug.cgi?id=750568
This commit is contained in:
Cosimo Cecchi 2015-06-16 12:01:30 -07:00
parent 1e6ccf5c86
commit 3b1b171be5
3 changed files with 61 additions and 1 deletions

View File

@ -7775,6 +7775,8 @@ gtk_overlay_new
gtk_overlay_add_overlay
gtk_overlay_add_pass_through_overlay
gtk_overlay_reorder_overlay
gtk_overlay_get_overlay_pass_through
gtk_overlay_set_overlay_pass_through
<SUBSECTION Standard>
GTK_TYPE_OVERLAY

View File

@ -897,6 +897,58 @@ gtk_overlay_add_overlay (GtkOverlay *overlay,
gtk_widget_child_notify (widget, "index");
}
/**
* gtk_overlay_set_overlay_pass_through:
* @overlay: a #GtkOverlay
* @widget: an overlay child of #GtkOverlay
* @pass_through: whether the child should pass the input through
*
* Convenience function to set the value of the #GtkOverlay:pass-through
* child property for @widget.
*
* Since: 3.18
*/
void
gtk_overlay_set_overlay_pass_through (GtkOverlay *overlay,
GtkWidget *widget,
gboolean pass_through)
{
g_return_if_fail (GTK_IS_OVERLAY (overlay));
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_container_child_set (GTK_CONTAINER (overlay), widget,
"pass-through", pass_through,
NULL);
}
/**
* gtk_overlay_get_overlay_pass_through:
* @overlay: a #GtkOverlay
* @widget: an overlay child of #GtkOverlay
*
* Convenience function to get the value of the #GtkOverlay:pass-through
* child property for @widget.
*
* Returns: whether the widget is a pass through child.
*
* Since: 3.18
*/
gboolean
gtk_overlay_get_overlay_pass_through (GtkOverlay *overlay,
GtkWidget *widget)
{
gboolean pass_through;
g_return_val_if_fail (GTK_IS_OVERLAY (overlay), FALSE);
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
gtk_container_child_get (GTK_CONTAINER (overlay), widget,
"pass-through", &pass_through,
NULL);
return pass_through;
}
/**
* gtk_overlay_add_pass_through_overlay:
* @overlay: a #GtkOverlay

View File

@ -90,7 +90,13 @@ GDK_AVAILABLE_IN_3_18
void gtk_overlay_reorder_overlay (GtkOverlay *overlay,
GtkWidget *child,
gint position);
GDK_AVAILABLE_IN_3_18
gboolean gtk_overlay_get_overlay_pass_through (GtkOverlay *overlay,
GtkWidget *widget);
GDK_AVAILABLE_IN_3_18
void gtk_overlay_set_overlay_pass_through (GtkOverlay *overlay,
GtkWidget *widget,
gboolean pass_through);
G_END_DECLS