]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcontainer.c
Revert name change
[~andy/gtk] / gtk / gtkcontainer.c
index 8f1835dd4163da89e26d7d7ece26be4e50702335..a93ddeec7c0affe8d71433a845d2256e94190ab9 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include <config.h>
+#include "config.h"
 #include <stdarg.h>
 #include <string.h>
 #include <stdlib.h>
@@ -537,8 +537,8 @@ container_set_child_property (GtkContainer       *container,
  * @container: a #GtkContainer
  * @child: a widget which is a child of @container
  * @first_property_name: the name of the first property to get
- * @var_args: a %NULL-terminated list of property names and #GValue*, 
- *           starting with @first_prop_name.
+ * @var_args: return location for the first property, followed 
+ *     optionally by more name/return location pairs, followed by %NULL
  * 
  * Gets the values of one or more child properties for @child and @container.
  **/
@@ -819,6 +819,7 @@ gtk_container_add_with_properties (GtkContainer *container,
   g_return_if_fail (GTK_IS_CONTAINER (container));
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (widget->parent == NULL);
+  g_return_if_fail (widget->parent == container);
 
   g_object_ref (container);
   g_object_ref (widget);
@@ -871,8 +872,8 @@ gtk_container_child_set (GtkContainer      *container,
  * @container: a #GtkContainer
  * @child: a widget which is a child of @container
  * @first_prop_name: the name of the first property to get
- * @Varargs: a %NULL-terminated list of property names and #GValue*, 
- *           starting with @first_prop_name
+ * @Varargs: return location for the first property, followed 
+ *     optionally by more name/return location pairs, followed by %NULL
  * 
  * Gets the values of one or more child properties for @child and @container.
  **/
@@ -1083,8 +1084,9 @@ gtk_container_get_property (GObject         *object,
  * #GtkWindow; because toplevel windows can't leave space outside,
  * they leave the space inside. The border is added on all sides of
  * the container. To add space to only one side, one approach is to
- * create a #GtkAlignment widget, call gtk_widget_set_usize() to give
- * it a size, and place it on the side of the container as a spacer.
+ * create a #GtkAlignment widget, call gtk_widget_set_size_request()
+ * to give it a size, and place it on the side of the container as
+ * a spacer.
  **/
 void
 gtk_container_set_border_width (GtkContainer *container,
@@ -1144,7 +1146,8 @@ gtk_container_add (GtkContainer *container,
     {
       g_warning ("Attempting to add a widget with type %s to a container of "
                  "type %s, but the widget is already inside a container of type %s, "
-                 "the GTK+ FAQ at http://www.gtk.org/faq/ explains how to reparent a widget.",
+                 "the GTK+ FAQ at http://library.gnome.org/devel/gtk-faq/stable/ "
+                 "explains how to reparent a widget.",
                  g_type_name (G_OBJECT_TYPE (widget)),
                  g_type_name (G_OBJECT_TYPE (container)),
                  g_type_name (G_OBJECT_TYPE (widget->parent)));
@@ -1511,7 +1514,7 @@ gtk_container_foreach_full (GtkContainer       *container,
                            GtkCallback         callback,
                            GtkCallbackMarshal  marshal,
                            gpointer            callback_data,
-                           GtkDestroyNotify    notify)
+                           GDestroyNotify      notify)
 {
   g_return_if_fail (GTK_IS_CONTAINER (container));
 
@@ -1536,6 +1539,17 @@ gtk_container_foreach_full (GtkContainer       *container,
     notify (callback_data);
 }
 
+/**
+ * gtk_container_set_focus_child:
+ * @container: a #GtkContainer
+ * @widget: a #GtkWidget, or %NULL
+ *
+ * Sets, or unsets if @widget is %NULL, the focused child of @container.
+ *
+ * This function emits the GtkContainer::set_focus_child signal of
+ * @container. Implementations of #GtkContainer can override the
+ * default behaviour by overriding the class closure of this signal.
+ */
 void
 gtk_container_set_focus_child (GtkContainer *container,
                               GtkWidget    *widget)
@@ -1547,6 +1561,25 @@ gtk_container_set_focus_child (GtkContainer *container,
   g_signal_emit (container, container_signals[SET_FOCUS_CHILD], 0, widget);
 }
 
+/**
+ * gtk_container_get_focus_child:
+ * @container: a #GtkContainer
+ *
+ * Returns the current focus child widget inside @container.
+ *
+ * Returns: The child widget which has the focus
+ *          inside @container, or %NULL if none is set.
+ *
+ * Since: 2.14
+ **/
+GtkWidget *
+gtk_container_get_focus_child (GtkContainer *container)
+{
+  g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
+
+  return container->focus_child;
+}
+
 /**
  * gtk_container_get_children:
  * @container: a #GtkContainer
@@ -1866,8 +1899,8 @@ old_focus_coords (GtkContainer *container,
 {
   GtkWidget *widget = GTK_WIDGET (container);
   GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
-  
-  if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget)
+
+  if (GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget)
     {
       GtkWidget *old_focus = GTK_WINDOW (toplevel)->focus_widget;