[aseprite] 43/308: Rename ui::Widget::getChildren() -> children()

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:44:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 78ba2134711468daf07725ced8f788bad620a705
Author: David Capello <davidcapello at gmail.com>
Date:   Thu Dec 3 19:46:13 2015 -0300

    Rename ui::Widget::getChildren() -> children()
    
    Extra changes:
    * Removed UI_FOREACH_WIDGET(), replaced with range-based for-loops
---
 src/app/app_menus.cpp                              |  4 +-
 src/app/commands/cmd_keyboard_shortcuts.cpp        |  6 +-
 src/app/commands/cmd_undo_history.cpp              |  2 +-
 .../commands/filters/cmd_convolution_matrix.cpp    | 10 ++-
 src/app/modules/gui.cpp                            |  4 +-
 src/app/ui/brush_popup.cpp                         |  6 +-
 src/app/ui/button_set.cpp                          |  8 +--
 src/app/ui/data_recovery_view.cpp                  |  2 +-
 src/app/ui/font_popup.cpp                          |  2 +-
 src/app/ui/workspace.cpp                           |  6 +-
 src/app/ui/workspace_panel.cpp                     |  2 +-
 src/ui/LICENSE.txt                                 |  2 +-
 src/ui/box.cpp                                     |  8 +--
 src/ui/button.cpp                                  |  4 +-
 src/ui/listbox.cpp                                 | 22 +++----
 src/ui/listitem.cpp                                |  8 +--
 src/ui/manager.cpp                                 | 77 +++++++++++-----------
 src/ui/menu.cpp                                    | 46 +++++--------
 src/ui/message.cpp                                 |  4 +-
 src/ui/panel.cpp                                   | 10 +--
 src/ui/popup_window.cpp                            |  6 +-
 src/ui/separator.cpp                               |  3 +-
 src/ui/splitter.cpp                                | 16 ++---
 src/ui/tooltips.cpp                                |  6 +-
 src/ui/view.cpp                                    |  4 +-
 src/ui/viewport.cpp                                |  7 +-
 src/ui/widget.cpp                                  | 60 ++++++++---------
 src/ui/widget.h                                    |  5 +-
 src/ui/widgets_list.h                              |  9 +--
 src/ui/window.cpp                                  | 16 ++---
 30 files changed, 160 insertions(+), 205 deletions(-)

diff --git a/src/app/app_menus.cpp b/src/app/app_menus.cpp
index a5fe752..b1fbd3f 100644
--- a/src/app/app_menus.cpp
+++ b/src/app/app_menus.cpp
@@ -297,9 +297,7 @@ void AppMenus::applyShortcutToMenuitemsWithCommand(Command* command, const Param
 
 void AppMenus::applyShortcutToMenuitemsWithCommand(Menu* menu, Command* command, const Params& params, Key* key)
 {
-  UI_FOREACH_WIDGET(menu->getChildren(), it) {
-    Widget* child = *it;
-
+  for (auto child : menu->children()) {
     if (child->type() == kMenuItemWidget) {
       AppMenuItem* menuitem = dynamic_cast<AppMenuItem*>(child);
       if (!menuitem)
diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp
index 3cc48b2..144c536 100644
--- a/src/app/commands/cmd_keyboard_shortcuts.cpp
+++ b/src/app/commands/cmd_keyboard_shortcuts.cpp
@@ -400,7 +400,7 @@ private:
     for (auto listBox : listBoxes) {
       Separator* group = nullptr;
 
-      for (auto item : listBox->getChildren()) {
+      for (auto item : listBox->children()) {
         if (KeyItem* keyItem = dynamic_cast<KeyItem*>(item)) {
           std::string itemText =
             base::string_to_lower(keyItem->getText());
@@ -414,7 +414,7 @@ private:
           if (matches == int(parts.size())) {
             if (!group) {
               group = new Separator(
-                section()->getChildren()[sectionIdx]->getText(), HORIZONTAL);
+                section()->children()[sectionIdx]->getText(), HORIZONTAL);
               group->setBgColor(SkinTheme::instance()->colors.background());
 
               searchList()->addChild(group);
@@ -496,7 +496,7 @@ private:
   }
 
   void fillList(ListBox* listbox, Menu* menu, int level) {
-    for (Widget* child : menu->getChildren()) {
+    for (auto child : menu->children()) {
       if (AppMenuItem* menuItem = dynamic_cast<AppMenuItem*>(child)) {
         if (menuItem == AppMenus::instance()->getRecentListMenuitem())
           continue;
diff --git a/src/app/commands/cmd_undo_history.cpp b/src/app/commands/cmd_undo_history.cpp
index a6ce094..dfd0ff3 100644
--- a/src/app/commands/cmd_undo_history.cpp
+++ b/src/app/commands/cmd_undo_history.cpp
@@ -189,7 +189,7 @@ private:
   }
 
   void selectState(const undo::UndoState* state) {
-    for (auto child : actions()->getChildren()) {
+    for (auto child : actions()->children()) {
       Item* item = static_cast<Item*>(child);
       if (item->state() == state) {
         actions()->selectChild(item);
diff --git a/src/app/commands/filters/cmd_convolution_matrix.cpp b/src/app/commands/filters/cmd_convolution_matrix.cpp
index 0062183..7bb7315 100644
--- a/src/app/commands/filters/cmd_convolution_matrix.cpp
+++ b/src/app/commands/filters/cmd_convolution_matrix.cpp
@@ -83,8 +83,8 @@ private:
     const char* oldSelected = (m_filter.getMatrix() ? m_filter.getMatrix()->getName(): NULL);
 
     // Clean the list
-    while (!m_stockListBox->getChildren().empty()) {
-      Widget* listitem = m_stockListBox->getChildren().front();
+    while (!m_stockListBox->children().empty()) {
+      Widget* listitem = m_stockListBox->children().front();
       m_stockListBox->removeChild(listitem);
       delete listitem;
     }
@@ -101,12 +101,10 @@ private:
 
   void selectMatrixByName(const char* oldSelected)
   {
-    Widget* select_this = UI_FIRST_WIDGET(m_stockListBox->getChildren());
+    Widget* select_this = UI_FIRST_WIDGET(m_stockListBox->children());
 
     if (oldSelected) {
-      UI_FOREACH_WIDGET(m_stockListBox->getChildren(), it) {
-        Widget* child = *it;
-
+      for (auto child : m_stockListBox->children()) {
         if (child->getText() == oldSelected) {
           select_this = child;
           break;
diff --git a/src/app/modules/gui.cpp b/src/app/modules/gui.cpp
index 6fbddcc..3b97bf8 100644
--- a/src/app/modules/gui.cpp
+++ b/src/app/modules/gui.cpp
@@ -433,8 +433,8 @@ bool CustomizedGuiManager::onProcessMessage(Message* msg)
 
               // Commands are executed only when the main window is
               // the current window running at foreground.
-              UI_FOREACH_WIDGET(getChildren(), it) {
-                Window* child = static_cast<Window*>(*it);
+              for (auto childWidget : children()) {
+                Window* child = static_cast<Window*>(childWidget);
 
                 // There are a foreground window executing?
                 if (child->isForeground()) {
diff --git a/src/app/ui/brush_popup.cpp b/src/app/ui/brush_popup.cpp
index 61cf54c..dcfd64a 100644
--- a/src/app/ui/brush_popup.cpp
+++ b/src/app/ui/brush_popup.cpp
@@ -122,7 +122,7 @@ BrushPopup::BrushPopup(BrushPopupDelegate* delegate)
 
 void BrushPopup::setBrush(Brush* brush)
 {
-  for (auto child : m_buttons->getChildren()) {
+  for (auto child : m_buttons->children()) {
     Item* item = static_cast<Item*>(child);
 
     // Same type and same image
@@ -141,7 +141,7 @@ void BrushPopup::regenerate(const gfx::Rect& box, const Brushes& brushes)
   int columns = 3;
 
   if (m_buttons) {
-    for (auto child : m_buttons->getChildren())
+    for (auto child : m_buttons->children())
       m_tooltipManager->removeTooltipFor(child);
     removeChild(m_buttons.get());
     m_buttons.reset();
@@ -186,7 +186,7 @@ void BrushPopup::regenerate(const gfx::Rect& box, const Brushes& brushes)
   addChild(m_buttons.get());
 
   gfx::Rect rc = box;
-  int buttons = m_buttons->getChildren().size();
+  int buttons = m_buttons->children().size();
   int rows = (buttons/columns + ((buttons%columns) > 0 ? 1: 0));
   rc.w *= columns;
   rc.h = rows * (rc.h-2*guiscale()) + 2*guiscale();
diff --git a/src/app/ui/button_set.cpp b/src/app/ui/button_set.cpp
index 6949af5..9961b1d 100644
--- a/src/app/ui/button_set.cpp
+++ b/src/app/ui/button_set.cpp
@@ -271,7 +271,7 @@ ButtonSet::Item* ButtonSet::getItem(int index)
 int ButtonSet::selectedItem() const
 {
   int index = 0;
-  for (Widget* child : getChildren()) {
+  for (Widget* child : children()) {
     if (child->isSelected())
       return index;
     ++index;
@@ -281,7 +281,7 @@ int ButtonSet::selectedItem() const
 
 void ButtonSet::setSelectedItem(int index)
 {
-  if (index >= 0 && index < (int)getChildren().size())
+  if (index >= 0 && index < (int)children().size())
     setSelectedItem(static_cast<Item*>(at(index)));
   else
     setSelectedItem(static_cast<Item*>(NULL));
@@ -338,11 +338,11 @@ void ButtonSet::onRightClick(Item* item)
 
 ButtonSet::Item* ButtonSet::findSelectedItem() const
 {
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (child->isSelected())
       return static_cast<Item*>(child);
   }
-  return NULL;
+  return nullptr;
 }
 
 } // namespace app
diff --git a/src/app/ui/data_recovery_view.cpp b/src/app/ui/data_recovery_view.cpp
index 0adf89d..8105c66 100644
--- a/src/app/ui/data_recovery_view.cpp
+++ b/src/app/ui/data_recovery_view.cpp
@@ -153,7 +153,7 @@ DataRecoveryView::~DataRecoveryView()
 
 void DataRecoveryView::fillList()
 {
-  WidgetsList children = m_listBox.getChildren();
+  WidgetsList children = m_listBox.children();
   for (auto child : children) {
     m_listBox.removeChild(child);
     child->deferDelete();
diff --git a/src/app/ui/font_popup.cpp b/src/app/ui/font_popup.cpp
index 766f0c5..745fd7b 100644
--- a/src/app/ui/font_popup.cpp
+++ b/src/app/ui/font_popup.cpp
@@ -200,7 +200,7 @@ FontPopup::FontPopup()
       m_listBox.addChild(new FontItem(file));
   }
 
-  if (m_listBox.getChildren().empty())
+  if (m_listBox.children().empty())
     m_listBox.addChild(new ListItem("No system fonts were found"));
 }
 
diff --git a/src/app/ui/workspace.cpp b/src/app/ui/workspace.cpp
index fb6525a..dc86d3c 100644
--- a/src/app/ui/workspace.cpp
+++ b/src/app/ui/workspace.cpp
@@ -141,7 +141,7 @@ void Workspace::duplicateActiveView()
 
 void Workspace::updateTabs()
 {
-  WidgetsList children = getChildren();
+  WidgetsList children = this->children();
   while (!children.empty()) {
     Widget* child = children.back();
     children.erase(--children.end());
@@ -149,7 +149,7 @@ void Workspace::updateTabs()
     if (child->type() == WorkspacePanel::Type())
       static_cast<WorkspacePanel*>(child)->tabs()->updateTabs();
 
-    for (auto subchild : child->getChildren())
+    for (auto subchild : child->children())
       children.push_back(subchild);
   }
 }
@@ -164,7 +164,7 @@ void Workspace::onResize(ui::ResizeEvent& ev)
   setBoundsQuietly(ev.getBounds());
 
   gfx::Rect rc = getChildrenBounds();
-  for (Widget* child : getChildren())
+  for (auto child : children())
     child->setBounds(rc);
 }
 
diff --git a/src/app/ui/workspace_panel.cpp b/src/app/ui/workspace_panel.cpp
index 67b58e4..30d9e26 100644
--- a/src/app/ui/workspace_panel.cpp
+++ b/src/app/ui/workspace_panel.cpp
@@ -176,7 +176,7 @@ void WorkspacePanel::adjustActiveViewBounds()
     rc.h -= int(inbetween(0.0, threshold, top) + inbetween(0.0, threshold, bottom));
   }
 
-  for (Widget* child : getChildren())
+  for (auto child : children())
     if (child->isVisible())
       child->setBounds(rc);
 }
diff --git a/src/ui/LICENSE.txt b/src/ui/LICENSE.txt
index 220ac0d..7ed8f20 100644
--- a/src/ui/LICENSE.txt
+++ b/src/ui/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2001-2014 David Capello
+Copyright (c) 2001-2015 David Capello
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/src/ui/box.cpp b/src/ui/box.cpp
index c9018fc..e269aba 100644
--- a/src/ui/box.cpp
+++ b/src/ui/box.cpp
@@ -43,13 +43,13 @@ void Box::onPreferredSize(PreferredSizeEvent& ev)
   }
 
   int visibleChildren = 0;
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (!child->hasFlags(HIDDEN))
       ++visibleChildren;
   }
 
   Size prefSize(0, 0);
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (child->hasFlags(HIDDEN))
       continue;
 
@@ -87,7 +87,7 @@ void Box::onResize(ResizeEvent& ev)
                                                                         \
     Rect childPos(getChildrenBounds());                                 \
     int i = 0, j = 0;                                                   \
-    for (Widget* child : getChildren()) {                               \
+    for (auto child : children()) {                                     \
       if (child->hasFlags(HIDDEN))                                      \
         continue;                                                       \
                                                                         \
@@ -123,7 +123,7 @@ void Box::onResize(ResizeEvent& ev)
 
   int visibleChildren = 0;
   int expansiveChildren = 0;
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (!child->hasFlags(HIDDEN)) {
       ++visibleChildren;
       if (child->isExpansive())
diff --git a/src/ui/button.cpp b/src/ui/button.cpp
index 1b6712e..e62ba65 100644
--- a/src/ui/button.cpp
+++ b/src/ui/button.cpp
@@ -364,8 +364,8 @@ void RadioButton::deselectRadioGroup()
         radioButton->setSelected(false);
     }
 
-    UI_FOREACH_WIDGET(widget->getChildren(), it) {
-      allChildrens.push(*it);
+    for (auto child : widget->children()) {
+      allChildrens.push(child);
     }
   }
 }
diff --git a/src/ui/listbox.cpp b/src/ui/listbox.cpp
index f64cff7..462cd3e 100644
--- a/src/ui/listbox.cpp
+++ b/src/ui/listbox.cpp
@@ -32,7 +32,7 @@ ListBox::ListBox()
 
 Widget* ListBox::getSelectedChild()
 {
-  for (Widget* child : getChildren())
+  for (auto child : children())
     if (child->isSelected())
       return child;
 
@@ -43,7 +43,7 @@ int ListBox::getSelectedIndex()
 {
   int i = 0;
 
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (child->isSelected())
       return i;
 
@@ -55,7 +55,7 @@ int ListBox::getSelectedIndex()
 
 void ListBox::selectChild(Widget* item)
 {
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (child->isSelected()) {
       if (item && child == item)
         return;
@@ -74,7 +74,7 @@ void ListBox::selectChild(Widget* item)
 
 void ListBox::selectIndex(int index)
 {
-  const WidgetsList& children = getChildren();
+  const WidgetsList& children = this->children();
   if (index < 0 || index >= (int)children.size())
     return;
 
@@ -85,7 +85,7 @@ void ListBox::selectIndex(int index)
 
 std::size_t ListBox::getItemsCount() const
 {
-  return getChildren().size();
+  return children().size();
 }
 
 void ListBox::makeChildVisible(Widget* child)
@@ -129,7 +129,7 @@ inline bool sort_by_text(Widget* a, Widget* b) {
 
 void ListBox::sortItems()
 {
-  WidgetsList widgets = getChildren();
+  WidgetsList widgets = children();
   std::sort(widgets.begin(), widgets.end(), &sort_by_text);
 
   // Remove all children and add then again.
@@ -207,10 +207,10 @@ bool ListBox::onProcessMessage(Message* msg)
     }
 
     case kKeyDownMessage:
-      if (hasFocus() && !getChildren().empty()) {
+      if (hasFocus() && !children().empty()) {
         int select = getSelectedIndex();
         View* view = View::getView(this);
-        int bottom = MAX(0, getChildren().size()-1);
+        int bottom = MAX(0, children().size()-1);
         KeyMessage* keymsg = static_cast<KeyMessage*>(msg);
 
         switch (keymsg->scancode()) {
@@ -288,9 +288,7 @@ void ListBox::onResize(ResizeEvent& ev)
 
   Rect cpos = getChildrenBounds();
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
-
+  for (auto child : children()) {
     cpos.h = child->getPreferredSize().h;
     child->setBounds(cpos);
 
@@ -302,7 +300,7 @@ void ListBox::onPreferredSize(PreferredSizeEvent& ev)
 {
   int w = 0, h = 0;
 
-  UI_FOREACH_WIDGET_WITH_END(getChildren(), it, end) {
+  UI_FOREACH_WIDGET_WITH_END(children(), it, end) {
     Size reqSize = static_cast<ListItem*>(*it)->getPreferredSize();
 
     w = MAX(w, reqSize.w);
diff --git a/src/ui/listitem.cpp b/src/ui/listitem.cpp
index 5f8222c..bd4b677 100644
--- a/src/ui/listitem.cpp
+++ b/src/ui/listitem.cpp
@@ -39,8 +39,8 @@ void ListItem::onResize(ResizeEvent& ev)
   setBoundsQuietly(ev.getBounds());
 
   Rect crect = getChildrenBounds();
-  UI_FOREACH_WIDGET(getChildren(), it)
-    (*it)->setBounds(crect);
+  for (auto child : children())
+    child->setBounds(crect);
 }
 
 void ListItem::onPreferredSize(PreferredSizeEvent& ev)
@@ -53,8 +53,8 @@ void ListItem::onPreferredSize(PreferredSizeEvent& ev)
   else
     maxSize.w = maxSize.h = 0;
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Size reqSize = (*it)->getPreferredSize();
+  for (auto child : children()) {
+    Size reqSize = child->getPreferredSize();
 
     maxSize.w = MAX(maxSize.w, reqSize.w);
     maxSize.h = MAX(maxSize.h, reqSize.h);
diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp
index 8f0d3e1..15ca7f2 100644
--- a/src/ui/manager.cpp
+++ b/src/ui/manager.cpp
@@ -170,7 +170,7 @@ void Manager::run()
     set_mouse_cursor(kArrowCursor);
   }
 
-  while (!getChildren().empty())
+  while (!children().empty())
     loop.pumpMessages();
 }
 
@@ -205,14 +205,12 @@ void Manager::flipDisplay()
 bool Manager::generateMessages()
 {
   // First check: there are windows to manage?
-  if (getChildren().empty())
+  if (children().empty())
     return false;
 
   // New windows to show?
   if (!new_windows.empty()) {
-    UI_FOREACH_WIDGET(new_windows, it) {
-      Widget* window = *it;
-
+    for (auto window : new_windows) {
       // Relayout
       window->layout();
 
@@ -401,9 +399,9 @@ void Manager::handleMouseMove(const gfx::Point& mousePos,
   broadcastMouseMessage(mouse_widgets_list);
 
   // Get the widget under the mouse
-  Widget* widget = NULL;
-  UI_FOREACH_WIDGET(mouse_widgets_list, it) {
-    widget = (*it)->pick(mousePos);
+  Widget* widget = nullptr;
+  for (auto mouseWidget : mouse_widgets_list) {
+    widget = mouseWidget->pick(mousePos);
     if (widget)
       break;
   }
@@ -502,8 +500,8 @@ void Manager::handleWindowZOrder()
     if (window->isOnTop())
       win_manager->insertChild(0, window);
     else {
-      int pos = (int)win_manager->getChildren().size();
-      UI_FOREACH_WIDGET_BACKWARD(win_manager->getChildren(), it) {
+      int pos = (int)win_manager->children().size();
+      UI_FOREACH_WIDGET_BACKWARD(win_manager->children(), it) {
         if (static_cast<Window*>(*it)->isOnTop())
           break;
 
@@ -576,18 +574,18 @@ void Manager::enqueueMessage(Message* msg)
 
 Window* Manager::getTopWindow()
 {
-  return static_cast<Window*>(UI_FIRST_WIDGET(getChildren()));
+  return static_cast<Window*>(UI_FIRST_WIDGET(children()));
 }
 
 Window* Manager::getForegroundWindow()
 {
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Window* window = static_cast<Window*>(*it);
+  for (auto child : children()) {
+    Window* window = static_cast<Window*>(child);
     if (window->isForeground() ||
         window->isDesktop())
       return window;
   }
-  return NULL;
+  return nullptr;
 }
 
 Widget* Manager::getFocus()
@@ -951,8 +949,8 @@ void Manager::_closeWindow(Window* window, bool redraw_background)
 
   // Close all windows to this desktop
   if (window->isDesktop()) {
-    while (!getChildren().empty()) {
-      Window* child = static_cast<Window*>(getChildren().front());
+    while (!children().empty()) {
+      Window* child = static_cast<Window*>(children().front());
       if (child == window)
         break;
       else {
@@ -1019,11 +1017,11 @@ bool Manager::onProcessMessage(Message* msg)
       // Continue sending the message to the children of all windows
       // (until a desktop or foreground window).
       Window* win = nullptr;
-      for (Widget* manchild : getChildren()) {
+      for (auto manchild : children()) {
         win = static_cast<Window*>(manchild);
 
         // Send to the window.
-        for (auto winchild : win->getChildren())
+        for (auto winchild : win->children())
           if (winchild->sendMessage(msg))
             return true;
 
@@ -1058,8 +1056,8 @@ void Manager::onResize(ResizeEvent& ev)
   int dw = new_pos.w - old_pos.w;
   int dh = new_pos.h - old_pos.h;
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Window* window = static_cast<Window*>(*it);
+  for (auto child : children()) {
+    Window* window = static_cast<Window*>(child);
     if (window->isDesktop()) {
       window->setBounds(new_pos);
       break;
@@ -1097,7 +1095,7 @@ void Manager::onBroadcastMouseMessage(WidgetsList& targets)
 {
   // Ask to the first window in the "children" list to know how to
   // propagate mouse messages.
-  Widget* widget = UI_FIRST_WIDGET(getChildren());
+  Widget* widget = UI_FIRST_WIDGET(children());
   if (widget)
     widget->broadcastMouseMessage(targets);
 }
@@ -1134,8 +1132,8 @@ void Manager::onPreferredSize(PreferredSizeEvent& ev)
   else {
     gfx::Rect pos = getParent()->getChildrenBounds();
 
-    UI_FOREACH_WIDGET(getChildren(), it) {
-      gfx::Rect cpos = (*it)->getBounds();
+    for (auto child : children()) {
+      gfx::Rect cpos = child->getBounds();
       pos = pos.createUnion(cpos);
     }
 
@@ -1179,8 +1177,7 @@ void Manager::pumpQueue()
     }
 
     bool done = false;
-    UI_FOREACH_WIDGET(msg->recipients(), it2) {
-      Widget* widget = *it2;
+    for (auto widget : msg->recipients()) {
       if (!widget)
         continue;
 
@@ -1289,8 +1286,10 @@ void Manager::invalidateDisplayRegion(const gfx::Region& region)
 
   // Redraw windows from top to background.
   bool withDesktop = false;
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Window* window = static_cast<Window*>(*it);
+  for (auto child : children()) {
+    ASSERT(dynamic_cast<Window*>(child));
+    ASSERT(child->type() == kWindowWidget);
+    Window* window = static_cast<Window*>(child);
 
     // Invalidate regions of this window
     window->invalidateRegion(reg1);
@@ -1358,8 +1357,8 @@ Widget* Manager::findMagneticWidget(Widget* widget)
 {
   Widget* found;
 
-  UI_FOREACH_WIDGET(widget->getChildren(), it) {
-    found = findMagneticWidget(*it);
+  for (auto child : widget->children()) {
+    found = findMagneticWidget(child);
     if (found)
       return found;
   }
@@ -1421,7 +1420,7 @@ static bool move_focus(Manager* manager, Message* msg)
   if (focus_widget) {
     window = focus_widget->getRoot();
   }
-  else if (!manager->getChildren().empty()) {
+  else if (!manager->children().empty()) {
     window = manager->getTopWindow();
   }
 
@@ -1520,8 +1519,8 @@ static int count_widgets_accept_focus(Widget* widget)
 
   int count = 0;
 
-  UI_FOREACH_WIDGET(widget->getChildren(), it)
-    count += count_widgets_accept_focus(*it);
+  for (auto child : widget->children())
+    count += count_widgets_accept_focus(child);
 
   if ((count == 0) && (ACCEPT_FOCUS(widget)))
     count++;
@@ -1531,21 +1530,21 @@ static int count_widgets_accept_focus(Widget* widget)
 
 static bool childs_accept_focus(Widget* widget, bool first)
 {
-  UI_FOREACH_WIDGET(widget->getChildren(), it)
-    if (childs_accept_focus(*it, false))
+  for (auto child : widget->children())
+    if (childs_accept_focus(child, false))
       return true;
 
-  return first ? false: ACCEPT_FOCUS(widget);
+  return (first ? false: ACCEPT_FOCUS(widget));
 }
 
 static Widget* next_widget(Widget* widget)
 {
-  if (!widget->getChildren().empty())
-    return UI_FIRST_WIDGET(widget->getChildren());
+  if (!widget->children().empty())
+    return UI_FIRST_WIDGET(widget->children());
 
   while (widget->getParent()->type() != kManagerWidget) {
-    WidgetsList::const_iterator begin = widget->getParent()->getChildren().begin();
-    WidgetsList::const_iterator end = widget->getParent()->getChildren().end();
+    WidgetsList::const_iterator begin = widget->getParent()->children().begin();
+    WidgetsList::const_iterator end = widget->getParent()->children().end();
     WidgetsList::const_iterator it = std::find(begin, end, widget);
 
     ASSERT(it != end);
diff --git a/src/ui/menu.cpp b/src/ui/menu.cpp
index d98359e..a9bf0d1 100644
--- a/src/ui/menu.cpp
+++ b/src/ui/menu.cpp
@@ -210,10 +210,10 @@ MenuItem::~MenuItem()
 
 Menu* MenuBox::getMenu()
 {
-  if (getChildren().empty())
-    return NULL;
+  if (children().empty())
+    return nullptr;
   else
-    return static_cast<Menu*>(getChildren().front());
+    return static_cast<Menu*>(children().front());
 }
 
 MenuBaseData* MenuBox::createBase()
@@ -264,7 +264,7 @@ void MenuItem::setHighlighted(bool state)
 
 bool MenuItem::hasSubmenu() const
 {
-  return (m_submenu && !m_submenu->getChildren().empty());
+  return (m_submenu && !m_submenu->children().empty());
 }
 
 void Menu::showPopup(const gfx::Point& pos)
@@ -319,8 +319,7 @@ void Menu::onResize(ResizeEvent& ev)
   Rect cpos = getChildrenBounds();
   bool isBar = (getParent()->type() == kMenuBarWidget);
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     Size reqSize = child->getPreferredSize();
 
     if (isBar)
@@ -342,7 +341,7 @@ void Menu::onPreferredSize(PreferredSizeEvent& ev)
   Size size(0, 0);
   Size reqSize;
 
-  UI_FOREACH_WIDGET_WITH_END(getChildren(), it, end) {
+  UI_FOREACH_WIDGET_WITH_END(children(), it, end) {
     reqSize = (*it)->getPreferredSize();
 
     if (getParent() && getParent()->type() == kMenuBarWidget) {
@@ -502,8 +501,7 @@ bool MenuBox::onProcessMessage(Message* msg)
           bool used = false;
 
           // Search a child with highlight or the submenu opened
-          UI_FOREACH_WIDGET(menu->getChildren(), it) {
-            Widget* child = *it;
+          for (auto child : menu->children()) {
             if (child->type() != kMenuItemWidget)
               continue;
 
@@ -779,9 +777,7 @@ bool MenuItem::onProcessMessage(Message* msg)
           // Select the first child
           MenuItem* first_child = NULL;
 
-          UI_FOREACH_WIDGET(m_submenu->getChildren(), it) {
-            Widget* child = *it;
-
+          for (auto child : m_submenu->children()) {
             if (child->type() != kMenuItemWidget)
               continue;
 
@@ -938,8 +934,7 @@ static MenuBaseData* get_base(Widget* widget)
 
 MenuItem* Menu::getHighlightedItem()
 {
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     if (child->type() != kMenuItemWidget)
       continue;
 
@@ -953,8 +948,7 @@ MenuItem* Menu::getHighlightedItem()
 void Menu::highlightItem(MenuItem* menuitem, bool click, bool open_submenu, bool select_first_child)
 {
   // Find the menuitem with the highlight
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     if (child->type() != kMenuItemWidget)
       continue;
 
@@ -1027,8 +1021,7 @@ void MenuItem::openSubmenu(bool select_first)
 
   // Close all siblings of 'menuitem'
   if (menu->getParent()) {
-    UI_FOREACH_WIDGET(menu->getChildren(), it) {
-      Widget* child = *it;
+    for (auto child : menu->children()) {
       if (child->type() != kMenuItemWidget)
         continue;
 
@@ -1074,8 +1067,7 @@ void MenuItem::closeSubmenu(bool last_of_close_chain)
   menu = m_submenu_menubox->getMenu();
   ASSERT(menu != NULL);
 
-  UI_FOREACH_WIDGET(menu->getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : menu->children()) {
     if (child->type() != kMenuItemWidget)
       continue;
 
@@ -1149,8 +1141,7 @@ void Menu::closeAll()
       menuitem->closeSubmenu(true);
   }
   else {
-    UI_FOREACH_WIDGET(menu->getChildren(), it) {
-      Widget* child = *it;
+    for (auto child : menu->children()) {
       if (child->type() != kMenuItemWidget)
         continue;
 
@@ -1198,8 +1189,7 @@ void MenuItem::executeClick()
 
 static MenuItem* check_for_letter(Menu* menu, int ascii)
 {
-  UI_FOREACH_WIDGET(menu->getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : menu->children()) {
     if (child->type() != kMenuItemWidget)
       continue;
 
@@ -1215,8 +1205,8 @@ static MenuItem* check_for_letter(Menu* menu, int ascii)
 // from the first item in `menu'
 static MenuItem* find_nextitem(Menu* menu, MenuItem* menuitem)
 {
-  WidgetsList::const_iterator begin = menu->getChildren().begin();
-  WidgetsList::const_iterator it, end = menu->getChildren().end();
+  WidgetsList::const_iterator begin = menu->children().begin();
+  WidgetsList::const_iterator it, end = menu->children().end();
 
   if (menuitem) {
     it = std::find(begin, end, menuitem);
@@ -1240,8 +1230,8 @@ static MenuItem* find_nextitem(Menu* menu, MenuItem* menuitem)
 
 static MenuItem* find_previtem(Menu* menu, MenuItem* menuitem)
 {
-  WidgetsList::const_reverse_iterator begin = menu->getChildren().rbegin();
-  WidgetsList::const_reverse_iterator it, end = menu->getChildren().rend();
+  WidgetsList::const_reverse_iterator begin = menu->children().rbegin();
+  WidgetsList::const_reverse_iterator it, end = menu->children().rend();
 
   if (menuitem) {
     it = std::find(begin, end, menuitem);
diff --git a/src/ui/message.cpp b/src/ui/message.cpp
index 541f872..46e8e27 100644
--- a/src/ui/message.cpp
+++ b/src/ui/message.cpp
@@ -69,8 +69,8 @@ void Message::broadcastToChildren(Widget* widget)
 {
   ASSERT_VALID_WIDGET(widget);
 
-  UI_FOREACH_WIDGET(widget->getChildren(), it)
-    broadcastToChildren(*it);
+  for (auto child : widget->children())
+    broadcastToChildren(child);
 
   addRecipient(widget);
 }
diff --git a/src/ui/panel.cpp b/src/ui/panel.cpp
index 85e4beb..af5bff2 100644
--- a/src/ui/panel.cpp
+++ b/src/ui/panel.cpp
@@ -22,8 +22,7 @@ Panel::Panel()
 
 void Panel::showChild(Widget* widget)
 {
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     if (!child->isDecorative())
       child->setVisible(child == widget);
   }
@@ -37,8 +36,7 @@ void Panel::onResize(ResizeEvent& ev)
 
   // Set all the children to the same "cpos"
   gfx::Rect cpos = getChildrenBounds();
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     if (!child->isDecorative())
       child->setBounds(cpos);
   }
@@ -49,9 +47,7 @@ void Panel::onPreferredSize(PreferredSizeEvent& ev)
   gfx::Size maxSize(0, 0);
   gfx::Size reqSize;
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
-
+  for (auto child : children()) {
     if (!child->isDecorative()) {
       reqSize = child->getPreferredSize();
 
diff --git a/src/ui/popup_window.cpp b/src/ui/popup_window.cpp
index cf288d2..92ff0cd 100644
--- a/src/ui/popup_window.cpp
+++ b/src/ui/popup_window.cpp
@@ -163,13 +163,11 @@ void PopupWindow::onPreferredSize(PreferredSizeEvent& ev)
   resultSize.w += border().width();
   resultSize.h += border().height();
 
-  if (!getChildren().empty()) {
+  if (!children().empty()) {
     Size maxSize(0, 0);
     Size reqSize;
 
-    UI_FOREACH_WIDGET(getChildren(), it) {
-      Widget* child = *it;
-
+    for (auto child : children()) {
       reqSize = child->getPreferredSize();
 
       maxSize.w = MAX(maxSize.w, reqSize.w);
diff --git a/src/ui/separator.cpp b/src/ui/separator.cpp
index 3cfc09c..9b42693 100644
--- a/src/ui/separator.cpp
+++ b/src/ui/separator.cpp
@@ -38,8 +38,7 @@ void Separator::onPreferredSize(PreferredSizeEvent& ev)
 {
   Size maxSize(0, 0);
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     Size reqSize = child->getPreferredSize();
     maxSize.w = MAX(maxSize.w, reqSize.w);
     maxSize.h = MAX(maxSize.h, reqSize.h);
diff --git a/src/ui/splitter.cpp b/src/ui/splitter.cpp
index 92510e7..9db8c4c 100644
--- a/src/ui/splitter.cpp
+++ b/src/ui/splitter.cpp
@@ -55,7 +55,7 @@ bool Splitter::onProcessMessage(Message* msg)
 
         bar = click_bar = 0;
 
-        UI_FOREACH_WIDGET_WITH_END(getChildren(), it, end) {
+        UI_FOREACH_WIDGET_WITH_END(children(), it, end) {
           if (it+1 != end) {
             c1 = *it;
             c2 = *(it+1);
@@ -136,7 +136,7 @@ bool Splitter::onProcessMessage(Message* msg)
         int x1, y1, x2, y2;
         bool change_cursor = false;
 
-        UI_FOREACH_WIDGET_WITH_END(getChildren(), it, end) {
+        UI_FOREACH_WIDGET_WITH_END(children(), it, end) {
           if (it+1 != end) {
             c1 = *it;
             c2 = *(it+1);
@@ -256,7 +256,7 @@ void Splitter::onPreferredSize(PreferredSizeEvent& ev)
   Size reqSize;
 
   visibleChildren = 0;
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (child->isVisible())
       visibleChildren++;
   }
@@ -264,7 +264,7 @@ void Splitter::onPreferredSize(PreferredSizeEvent& ev)
   int w, h;
   w = h = 0;
 
-  for (Widget* child : getChildren()) {
+  for (auto child : children()) {
     if (!child->isVisible())
       continue;
 
@@ -297,7 +297,7 @@ void Splitter::onLoadLayout(LoadLayoutEvent& ev)
     m_pos *= guiscale();
 
   // Do for all children
-  for (Widget* child : getChildren())
+  for (auto child : children())
     child->loadLayout();
 }
 
@@ -307,13 +307,13 @@ void Splitter::onSaveLayout(SaveLayoutEvent& ev)
   ev.stream() << pos;
 
   // Do for all children
-  for (Widget* child : getChildren())
+  for (auto child : children())
     child->saveLayout();
 }
 
 Widget* Splitter::panel1() const
 {
-  const WidgetsList& list = getChildren();
+  const WidgetsList& list = children();
   if (list.size() >= 1 && list[0]->isVisible())
     return list[0];
   else
@@ -322,7 +322,7 @@ Widget* Splitter::panel1() const
 
 Widget* Splitter::panel2() const
 {
-  const WidgetsList& list = getChildren();
+  const WidgetsList& list = children();
   if (list.size() >= 2 && list[1]->isVisible())
     return list[1];
   else
diff --git a/src/ui/tooltips.cpp b/src/ui/tooltips.cpp
index a02b21f..a798cef 100644
--- a/src/ui/tooltips.cpp
+++ b/src/ui/tooltips.cpp
@@ -243,13 +243,11 @@ void TipWindow::onPreferredSize(PreferredSizeEvent& ev)
   resultSize.w += border().width();
   resultSize.h += border().height();
 
-  if (!getChildren().empty()) {
+  if (!children().empty()) {
     Size maxSize(0, 0);
     Size reqSize;
 
-    UI_FOREACH_WIDGET(getChildren(), it) {
-      Widget* child = *it;
-
+    for (auto child : children()) {
       reqSize = child->getPreferredSize();
 
       maxSize.w = MAX(maxSize.w, reqSize.w);
diff --git a/src/ui/view.cpp b/src/ui/view.cpp
index 274902f..361681e 100644
--- a/src/ui/view.cpp
+++ b/src/ui/view.cpp
@@ -52,7 +52,7 @@ void View::attachToView(Widget* viewable_widget)
 
 Widget* View::attachedWidget()
 {
-  return UI_FIRST_WIDGET(m_viewport.getChildren());
+  return UI_FIRST_WIDGET(m_viewport.children());
 }
 
 void View::makeVisibleAllScrollableArea()
@@ -147,7 +147,7 @@ void View::setViewScroll(const Point& pt)
 
 void View::updateView()
 {
-  Widget* vw = UI_FIRST_WIDGET(m_viewport.getChildren());
+  Widget* vw = UI_FIRST_WIDGET(m_viewport.children());
   Point scroll = getViewScroll();
 
   // Set minimum (remove scroll-bars)
diff --git a/src/ui/viewport.cpp b/src/ui/viewport.cpp
index c14fd66..6d666a2 100644
--- a/src/ui/viewport.cpp
+++ b/src/ui/viewport.cpp
@@ -38,8 +38,7 @@ void Viewport::onResize(ResizeEvent& ev)
   cpos.x = rect.x + border().left() - scroll.x;
   cpos.y = rect.y + border().top() - scroll.y;
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
+  for (auto child : children()) {
     Size reqSize = child->getPreferredSize();
 
     cpos.w = MAX(reqSize.w, rect.w - border().width());
@@ -65,8 +64,8 @@ Size Viewport::calculateNeededSize()
   Size maxSize(0, 0);
   Size reqSize;
 
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    reqSize = (*it)->getPreferredSize();
+  for (auto child : children()) {
+    reqSize = child->getPreferredSize();
     maxSize.w = MAX(maxSize.w, reqSize.w);
     maxSize.h = MAX(maxSize.h, reqSize.h);
   }
diff --git a/src/ui/widget.cpp b/src/ui/widget.cpp
index 01d5697..2459cea 100644
--- a/src/ui/widget.cpp
+++ b/src/ui/widget.cpp
@@ -448,20 +448,18 @@ bool Widget::hasAncestor(Widget* ancestor)
 
 Widget* Widget::findChild(const char* id)
 {
-  Widget* child;
-
-  UI_FOREACH_WIDGET(m_children, it) {
-    child = *it;
+  for (auto child : m_children) {
     if (child->getId() == id)
       return child;
   }
 
-  UI_FOREACH_WIDGET(m_children, it) {
-    if ((child = (*it)->findChild(id)))
-      return child;
+  for (auto child : m_children) {
+    auto subchild = child->findChild(id);
+    if (subchild)
+      return subchild;
   }
 
-  return NULL;
+  return nullptr;
 }
 
 Widget* Widget::findSibling(const char* id)
@@ -562,8 +560,8 @@ void Widget::loadLayout()
   }
 
   // Do for all children
-  UI_FOREACH_WIDGET(m_children, it)
-    (*it)->loadLayout();
+  for (auto child : m_children)
+    child->loadLayout();
 }
 
 void Widget::saveLayout()
@@ -582,8 +580,8 @@ void Widget::saveLayout()
   }
 
   // Do for all children
-  UI_FOREACH_WIDGET(m_children, it)
-    (*it)->saveLayout();
+  for (auto child : m_children)
+    child->saveLayout();
 }
 
 void Widget::setDecorativeWidgetBounds()
@@ -659,7 +657,7 @@ void Widget::getDrawableRegion(gfx::Region& region, DrawableRegionFlags flags)
     manager = window ? window->getManager(): NULL;
 
     while (manager) {
-      const WidgetsList& windows_list = manager->getChildren();
+      const WidgetsList& windows_list = manager->children();
       WidgetsList::const_reverse_iterator it =
         std::find(windows_list.rbegin(), windows_list.rend(), window);
 
@@ -683,12 +681,11 @@ void Widget::getDrawableRegion(gfx::Region& region, DrawableRegionFlags flags)
   }
 
   // Clip the areas where are children
-  if (!(flags & kUseChildArea) && !getChildren().empty()) {
+  if (!(flags & kUseChildArea) && !children().empty()) {
     Region reg1;
     Region reg2(getChildrenBounds());
 
-    UI_FOREACH_WIDGET(getChildren(), it) {
-      Widget* child = *it;
+    for (auto child : children()) {
       if (child->isVisible()) {
         Region reg3;
         child->getRegion(reg3);
@@ -888,8 +885,7 @@ void Widget::flushRedraw()
     if (!widget->isVisible())
       continue;
 
-    UI_FOREACH_WIDGET(widget->getChildren(), it) {
-      Widget* child = *it;
+    for (auto child : widget->children()) {
       if (child->hasFlags(DIRTY)) {
         child->disableFlags(DIRTY);
         processing.push(child);
@@ -941,10 +937,8 @@ void Widget::paint(Graphics* graphics, const gfx::Region& drawRegion)
     if (!widget->isVisible())
       continue;
 
-    UI_FOREACH_WIDGET(widget->getChildren(), it) {
-      Widget* child = *it;
+    for (auto child : widget->children())
       processing.push(child);
-    }
 
     // Intersect drawRegion with widget's drawable region.
     Region region;
@@ -1027,8 +1021,8 @@ void Widget::invalidate()
 
     mark_dirty_flag(this);
 
-    UI_FOREACH_WIDGET(getChildren(), it)
-      (*it)->invalidate();
+    for (auto child : m_children)
+      child->invalidate();
   }
 }
 
@@ -1301,8 +1295,8 @@ bool Widget::onProcessMessage(Message* msg)
     case kCloseMessage:
     case kWinMoveMessage:
       // Broadcast the message to the children.
-      UI_FOREACH_WIDGET(getChildren(), it)
-        (*it)->sendMessage(msg);
+      for (auto child : m_children)
+        child->sendMessage(msg);
       break;
 
     case kPaintMessage: {
@@ -1318,8 +1312,8 @@ bool Widget::onProcessMessage(Message* msg)
     case kKeyUpMessage:
       if (static_cast<KeyMessage*>(msg)->propagateToChildren()) {
         // Broadcast the message to the children.
-        UI_FOREACH_WIDGET(getChildren(), it)
-          if ((*it)->sendMessage(msg))
+        for (auto child : m_children)
+          if (child->sendMessage(msg))
             return true;
       }
 
@@ -1387,8 +1381,8 @@ void Widget::onInvalidateRegion(const Region& region)
 
     mark_dirty_flag(this);
 
-    UI_FOREACH_WIDGET(getChildren(), it)
-      (*it)->invalidateRegion(reg1);
+    for (auto child : m_children)
+      child->invalidateRegion(reg1);
   }
 }
 
@@ -1413,8 +1407,8 @@ void Widget::onResize(ResizeEvent& ev)
 
   // Set all the children to the same "cpos".
   gfx::Rect cpos = getChildrenBounds();
-  UI_FOREACH_WIDGET(getChildren(), it)
-    (*it)->setBounds(cpos);
+  for (auto child : m_children)
+    child->setBounds(cpos);
 }
 
 void Widget::onPaint(PaintEvent& ev)
@@ -1479,8 +1473,8 @@ void Widget::offsetWidgets(int dx, int dy)
   m_updateRegion.offset(dx, dy);
   m_bounds.offset(dx, dy);
 
-  UI_FOREACH_WIDGET(m_children, it)
-    (*it)->offsetWidgets(dx, dy);
+  for (auto child : m_children)
+    child->offsetWidgets(dx, dy);
 }
 
 } // namespace ui
diff --git a/src/ui/widget.h b/src/ui/widget.h
index fc0a6eb..9f67784 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -168,7 +168,7 @@ namespace ui {
     void getParents(bool ascendant, WidgetsList& parents);
 
     // Returns a list of children.
-    const WidgetsList& getChildren() const { return m_children; }
+    const WidgetsList& children() const { return m_children; }
 
     Widget* at(int index) { return m_children[index]; }
 
@@ -201,8 +201,7 @@ namespace ui {
 
     template<class T>
     T* findFirstChildByType() {
-      UI_FOREACH_WIDGET(m_children, it) {
-        Widget* child = *it;
+      for (auto child : m_children) {
         if (T* specificChild = dynamic_cast<T*>(child))
           return specificChild;
       }
diff --git a/src/ui/widgets_list.h b/src/ui/widgets_list.h
index 068932f..b8235d4 100644
--- a/src/ui/widgets_list.h
+++ b/src/ui/widgets_list.h
@@ -1,5 +1,5 @@
 // Aseprite UI Library
-// Copyright (C) 2001-2013  David Capello
+// Copyright (C) 2001-2013, 2015  David Capello
 //
 // This file is released under the terms of the MIT license.
 // Read LICENSE.txt for more information.
@@ -10,13 +10,6 @@
 
 #include <vector>
 
-#define UI_FOREACH_WIDGET(list_name, iterator_name)    \
-  for (WidgetsList::const_iterator                     \
-         iterator_name = (list_name).begin(),          \
-         __end = (list_name).end();                    \
-       iterator_name != __end;                         \
-       ++iterator_name)
-
 #define UI_FOREACH_WIDGET_BACKWARD(list_name, iterator_name)    \
   for (WidgetsList::const_reverse_iterator                      \
          iterator_name = (list_name).rbegin(),                  \
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index c451c1f..b9e2347 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -102,8 +102,8 @@ HitTest Window::hitTest(const gfx::Point& point)
 
 void Window::removeDecorativeWidgets()
 {
-  while (!getChildren().empty())
-    delete getChildren().front();
+  while (!children().empty())
+    delete children().front();
 }
 
 void Window::onClose(CloseEvent& ev)
@@ -266,8 +266,8 @@ void Window::closeWindow(Widget* killer)
 bool Window::isTopLevel()
 {
   Widget* manager = getManager();
-  if (!manager->getChildren().empty())
-    return (this == UI_FIRST_WIDGET(manager->getChildren()));
+  if (!manager->children().empty())
+    return (this == UI_FIRST_WIDGET(manager->children()));
   else
     return false;
 }
@@ -435,9 +435,7 @@ void Window::onPreferredSize(PreferredSizeEvent& ev)
     Size maxSize(0, 0);
     Size reqSize;
 
-    UI_FOREACH_WIDGET(getChildren(), it) {
-      Widget* child = *it;
-
+    for (auto child : children()) {
       if (!child->isDecorative()) {
         reqSize = child->getPreferredSize();
 
@@ -486,9 +484,7 @@ void Window::windowSetPosition(const gfx::Rect& rect)
   Rect cpos = getChildrenBounds();
 
   // Set all the children to the same "cpos"
-  UI_FOREACH_WIDGET(getChildren(), it) {
-    Widget* child = *it;
-
+  for (auto child : children()) {
     if (child->isDecorative())
       child->setDecorativeWidgetBounds();
     else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list