| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gtk/gtk_floating_container.h" | 5 #include "chrome/browser/gtk/gtk_floating_container.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <gtk/gtkprivate.h> | 8 #include <gtk/gtkprivate.h> |
| 9 #include <gtk/gtkmarshal.h> | 9 #include <gtk/gtkmarshal.h> |
| 10 | 10 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 g_return_if_fail(removed_child); | 167 g_return_if_fail(removed_child); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 static void gtk_floating_container_forall(GtkContainer* container, | 171 static void gtk_floating_container_forall(GtkContainer* container, |
| 172 gboolean include_internals, | 172 gboolean include_internals, |
| 173 GtkCallback callback, | 173 GtkCallback callback, |
| 174 gpointer callback_data) { | 174 gpointer callback_data) { |
| 175 GtkBin *bin = GTK_BIN(container); | 175 g_return_if_fail(container != NULL); |
| 176 | |
| 177 g_return_if_fail(callback != NULL); | 176 g_return_if_fail(callback != NULL); |
| 178 | 177 |
| 179 if (bin->child) | 178 // Let GtkBin do its part of the forall. |
| 180 (*callback)(bin->child, callback_data); | 179 ((GTK_CONTAINER_CLASS(gtk_floating_container_parent_class))->forall) |
| 180 (container, include_internals, callback, callback_data); |
| 181 | 181 |
| 182 GtkFloatingContainer* floating = GTK_FLOATING_CONTAINER(container); | 182 GtkFloatingContainer* floating = GTK_FLOATING_CONTAINER(container); |
| 183 GList* children = floating->floating_children; | 183 GList* children = floating->floating_children; |
| 184 while (children) { | 184 while (children) { |
| 185 GtkFloatingContainerChild* child = | 185 GtkFloatingContainerChild* child = |
| 186 reinterpret_cast<GtkFloatingContainerChild*>(children->data); | 186 reinterpret_cast<GtkFloatingContainerChild*>(children->data); |
| 187 children = children->next; | 187 children = children->next; |
| 188 | 188 |
| 189 (*callback)(child->widget, callback_data); | 189 (*callback)(child->widget, callback_data); |
| 190 } | 190 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 child_info->x = 0; | 311 child_info->x = 0; |
| 312 child_info->y = 0; | 312 child_info->y = 0; |
| 313 | 313 |
| 314 gtk_widget_set_parent(widget, GTK_WIDGET(container)); | 314 gtk_widget_set_parent(widget, GTK_WIDGET(container)); |
| 315 | 315 |
| 316 container->floating_children = | 316 container->floating_children = |
| 317 g_list_append(container->floating_children, child_info); | 317 g_list_append(container->floating_children, child_info); |
| 318 } | 318 } |
| 319 | 319 |
| 320 G_END_DECLS | 320 G_END_DECLS |
| OLD | NEW |