[gtk+/sdk/2965: 27/30] overlay: add setters and getters for pass-through child property



commit 4eddedeab0ebed422558cb399aed502d29b88999
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 16 12:01:30 2015 -0700

    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

 docs/reference/gtk/gtk3-sections.txt |    2 +
 gtk/gtkoverlay.c                     |   52 ++++++++++++++++++++++++++++++++++
 gtk/gtkoverlay.h                     |    8 ++++-
 3 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 757f171..590ffc9 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -7767,6 +7767,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 eb6ac04..993d66a 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.16
+ */
+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.16
+ */
+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 50b8950..af39a90 100644
--- a/gtk/gtkoverlay.h
+++ b/gtk/gtkoverlay.h
@@ -90,7 +90,13 @@ GDK_AVAILABLE_IN_3_16
 void       gtk_overlay_reorder_overlay (GtkOverlay     *overlay,
                                        GtkWidget      *child,
                                        gint            position);
-
+GDK_AVAILABLE_IN_3_16
+gboolean   gtk_overlay_get_overlay_pass_through (GtkOverlay *overlay,
+                                                GtkWidget  *widget);
+GDK_AVAILABLE_IN_3_16
+void       gtk_overlay_set_overlay_pass_through (GtkOverlay *overlay,
+                                                GtkWidget  *widget,
+                                                gboolean    pass_through);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]