summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2015-06-16 12:01:30 -0700
committerCosimo Cecchi <cosimoc@gnome.org>2015-06-17 11:48:37 -0700
commit3b1b171be54dc45dc566595d6fe245f6742fa042 (patch)
treeee6a4d3fd1dec2c0b5103b766e27caea25f1aae1
parent1e6ccf5c86e34df543206e61e0ab93d1925d9f79 (diff)
downloadgtk+-3b1b171be54dc45dc566595d6fe245f6742fa042.tar.gz
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
-rw-r--r--docs/reference/gtk/gtk3-sections.txt2
-rw-r--r--gtk/gtkoverlay.c52
-rw-r--r--gtk/gtkoverlay.h8
3 files changed, 61 insertions, 1 deletions
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index dd9cdf66ed..effa865b0b 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -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
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index eb6ac04177..efe85572dc 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -898,6 +898,58 @@ gtk_overlay_add_overlay (GtkOverlay *overlay,
}
/**
+ * 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
* @widget: a #GtkWidget to be added to the container
diff --git a/gtk/gtkoverlay.h b/gtk/gtkoverlay.h
index 5055f2f2a0..95700f974e 100644
--- a/gtk/gtkoverlay.h
+++ b/gtk/gtkoverlay.h
@@ -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