Rename namespace gui2::iterator -> iteration
I just don't like a namespace sharing the same name as its primary class.
This commit is contained in:
parent
bf5ad23879
commit
c630ee2fc1
28 changed files with 115 additions and 115 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Contains the exceptions throw by the @ref gui2::iterator::iterator classes.
|
||||
* Contains the exceptions thrown by the @ref gui2::iteration::iterator classes.
|
||||
*/
|
||||
|
||||
#ifndef GUI_WIDGETS_AUXILIARY_ITERATOR_EXCEPTION_HPP_INCLUDED
|
||||
|
@ -28,7 +28,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
IMPLEMENT_LUA_JAILBREAK_EXCEPTION(range_error)
|
||||
};
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
@ -46,16 +46,16 @@ namespace iterator
|
|||
*
|
||||
* @section gui2_iterator_level Level
|
||||
*
|
||||
* The levels are defined in @ref gui2::iterator::walker_base::level. The
|
||||
* The levels are defined in @ref gui2::iteration::walker_base::level. The
|
||||
* level allows the user to only visit a part of the widget tree.
|
||||
*
|
||||
* @note At the moment when gui2::iterator::walker_base::widget is skipped the
|
||||
* @note At the moment when gui2::iteration::walker_base::widget is skipped the
|
||||
* child class also skips its children. This behavior might change.
|
||||
*
|
||||
*
|
||||
* @section gui2_iterator_walker Walker
|
||||
*
|
||||
* The is a group of classes inheriting from @ref gui2::iterator::walker_base
|
||||
* The is a group of classes inheriting from @ref gui2::iteration::walker_base
|
||||
* the objects are created from @ref gui2::widget::create_walker. The
|
||||
* walker allows to visit the several levels of the widget. This means
|
||||
* several widgets need to override the function in a subclass. For example
|
||||
|
@ -68,8 +68,8 @@ namespace iterator
|
|||
*
|
||||
* This policy simply defines whether or not to visit the widgets at a
|
||||
* certain level. There are two visit policies:
|
||||
* - @ref gui2::iterator::policy::visit::visit_level visits the widget at the level.
|
||||
* - @ref gui2::iterator::policy::visit::skip_level skips the widget at the level.
|
||||
* - @ref gui2::iteration::policy::visit::visit_level visits the widget at the level.
|
||||
* - @ref gui2::iteration::policy::visit::skip_level skips the widget at the level.
|
||||
*
|
||||
* There are no more visit policies expected for the future. These policies
|
||||
* are normally not used directly, but set from the @ref
|
||||
|
@ -82,8 +82,8 @@ namespace iterator
|
|||
* first, this level before diving down etc. @ref tests/gui/iterator.cpp
|
||||
* shows more information.
|
||||
* The following policies have been defined:
|
||||
* - @ref gui2::iterator::policy::order::top_down
|
||||
* - @ref gui2::iterator::policy::order::bottom_up
|
||||
* - @ref gui2::iteration::policy::order::top_down
|
||||
* - @ref gui2::iteration::policy::order::bottom_up
|
||||
*
|
||||
* The next sections describe in which order the widgets are visited. In the
|
||||
* description we use the following widget tree.
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
namespace policy
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
~bottom_up()
|
||||
{
|
||||
delete root_;
|
||||
for(std::vector<iterator::walker_base*>::iterator itor = stack_.begin();
|
||||
for(std::vector<iteration::walker_base*>::iterator itor = stack_.begin();
|
||||
itor != stack_.end();
|
||||
++itor) {
|
||||
|
||||
|
@ -192,9 +192,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
iterator::walker_base* root_;
|
||||
iteration::walker_base* root_;
|
||||
|
||||
std::vector<iterator::walker_base*> stack_;
|
||||
std::vector<iteration::walker_base*> stack_;
|
||||
};
|
||||
|
||||
template <bool VW, bool VG, bool VC>
|
||||
|
@ -214,7 +214,7 @@ public:
|
|||
~top_down()
|
||||
{
|
||||
delete root_;
|
||||
for(std::vector<iterator::walker_base*>::iterator itor = stack_.begin();
|
||||
for(std::vector<iteration::walker_base*>::iterator itor = stack_.begin();
|
||||
itor != stack_.end();
|
||||
++itor) {
|
||||
|
||||
|
@ -346,16 +346,16 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
iterator::walker_base* root_;
|
||||
iteration::walker_base* root_;
|
||||
|
||||
std::vector<iterator::walker_base*> stack_;
|
||||
std::vector<iteration::walker_base*> stack_;
|
||||
};
|
||||
|
||||
} // namespace order
|
||||
|
||||
} // namespace policy
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
namespace policy
|
||||
|
@ -122,7 +122,7 @@ class visit_level<true, level> : public visit::visit_level<level>
|
|||
|
||||
} // namespace policy
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace gui2
|
|||
|
||||
class widget;
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
/** The walker abstract base class. */
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
virtual gui2::widget* get(const level level) = 0;
|
||||
};
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
grid::grid(gui2::grid& grid)
|
||||
|
@ -93,6 +93,6 @@ gui2::widget* grid::get(const level level)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
/** A walker for a @ref gui2::grid. */
|
||||
|
@ -36,13 +36,13 @@ public:
|
|||
*/
|
||||
explicit grid(gui2::grid& grid);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual state_t next(const level level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual bool at_end(const level level) const;
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual gui2::widget* get(const level level);
|
||||
|
||||
private:
|
||||
|
@ -53,7 +53,7 @@ private:
|
|||
* The grid which the walker is attached to.
|
||||
*
|
||||
* This variable is used to track whether the @ref
|
||||
* gui2::iterator::walker_base::widget level has been visited.
|
||||
* gui2::iteration::walker_base::widget level has been visited.
|
||||
*/
|
||||
gui2::widget* widget_;
|
||||
|
||||
|
@ -61,12 +61,12 @@ private:
|
|||
* The iterator to the children of @ref grid_.
|
||||
*
|
||||
* This variable is used to track where the @ref
|
||||
* gui2::iterator::walker_base::child level visiting is.
|
||||
* gui2::iteration::walker_base::child level visiting is.
|
||||
*/
|
||||
gui2::grid::iterator itor_;
|
||||
};
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
tree_node::tree_node(gui2::tree_view_node& node, boost::ptr_vector<gui2::tree_view_node>& children)
|
||||
|
@ -94,6 +94,6 @@ gui2::widget* tree_node::get(const level level)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace gui2
|
|||
|
||||
class tree_view_node;
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
/** A walker for a @ref gui2::tree_view_node. */
|
||||
|
@ -39,13 +39,13 @@ public:
|
|||
*/
|
||||
tree_node(gui2::tree_view_node& node, boost::ptr_vector<gui2::tree_view_node>& children);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual state_t next(const level level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual bool at_end(const level level) const;
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual gui2::widget* get(const level level);
|
||||
|
||||
private:
|
||||
|
@ -56,7 +56,7 @@ private:
|
|||
* The node which the walker is attached to.
|
||||
*
|
||||
* This variable is used to track whether the @ref
|
||||
* gui2::iterator::walker_base::widget level has been visited.
|
||||
* gui2::iteration::walker_base::widget level has been visited.
|
||||
*/
|
||||
gui2::widget* widget_;
|
||||
|
||||
|
@ -64,12 +64,12 @@ private:
|
|||
* The iterator to the children of @ref node_.
|
||||
*
|
||||
* This variable is used to track where the @ref
|
||||
* gui2::iterator::walker_base::child level visiting is.
|
||||
* gui2::iteration::walker_base::child level visiting is.
|
||||
*/
|
||||
boost::ptr_vector<gui2::tree_view_node>::iterator itor_;
|
||||
};
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
namespace walker
|
||||
|
@ -85,6 +85,6 @@ gui2::widget* widget::get(const level level)
|
|||
|
||||
} // namespace walker
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
namespace gui2
|
||||
{
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
|
||||
namespace walker
|
||||
|
@ -37,13 +37,13 @@ public:
|
|||
*/
|
||||
explicit widget(gui2::widget& widget);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual state_t next(const level level);
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual bool at_end(const level level) const;
|
||||
|
||||
/** Inherited from @ref gui2::iterator::walker_base. */
|
||||
/** Inherited from @ref gui2::iteration::walker_base. */
|
||||
virtual gui2::widget* get(const level level);
|
||||
|
||||
private:
|
||||
|
@ -53,7 +53,7 @@ private:
|
|||
|
||||
} // namespace walker
|
||||
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
} // namespace gui2
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
*
|
||||
* @todo Implement properly.
|
||||
*/
|
||||
virtual iterator::walker_base* create_walker() override
|
||||
virtual iteration::walker_base* create_walker() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -140,9 +140,9 @@ bool styled_widget::disable_click_dismiss() const
|
|||
return get_visible() == widget::visibility::visible && get_active();
|
||||
}
|
||||
|
||||
iterator::walker_base* styled_widget::create_walker()
|
||||
iteration::walker_base* styled_widget::create_walker()
|
||||
{
|
||||
return new iterator::walker::widget(*this);
|
||||
return new iteration::walker::widget(*this);
|
||||
}
|
||||
|
||||
point styled_widget::get_config_minimum_size() const
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
bool disable_click_dismiss() const override;
|
||||
|
||||
/** See @ref widget::create_walker. */
|
||||
virtual iterator::walker_base* create_walker() override;
|
||||
virtual iteration::walker_base* create_walker() override;
|
||||
|
||||
/***** ***** ***** ***** layout functions ***** ***** ***** *****/
|
||||
|
||||
|
|
|
@ -907,7 +907,7 @@ public:
|
|||
*
|
||||
* @todo Implement properly.
|
||||
*/
|
||||
virtual iterator::walker_base* create_walker() override
|
||||
virtual iteration::walker_base* create_walker() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -661,9 +661,9 @@ bool grid::disable_click_dismiss() const
|
|||
return false;
|
||||
}
|
||||
|
||||
iterator::walker_base* grid::create_walker()
|
||||
iteration::walker_base* grid::create_walker()
|
||||
{
|
||||
return new gui2::iterator::grid(*this);
|
||||
return new gui2::iteration::grid(*this);
|
||||
}
|
||||
|
||||
void grid::set_rows(const unsigned rows)
|
||||
|
|
|
@ -280,7 +280,7 @@ public:
|
|||
bool disable_click_dismiss() const override;
|
||||
|
||||
/** See @ref widget::create_walker. */
|
||||
virtual iterator::walker_base* create_walker() override;
|
||||
virtual iteration::walker_base* create_walker() override;
|
||||
|
||||
/***** ***** ***** setters / getters for members ***** ****** *****/
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ bool matrix::disable_click_dismiss() const
|
|||
return false;
|
||||
}
|
||||
|
||||
iterator::walker_base* matrix::create_walker()
|
||||
iteration::walker_base* matrix::create_walker()
|
||||
{
|
||||
/**
|
||||
* @todo Implement properly.
|
||||
|
|
|
@ -189,7 +189,7 @@ public:
|
|||
bool disable_click_dismiss() const override;
|
||||
|
||||
/** See @ref widget::create_walker. */
|
||||
virtual iterator::walker_base* create_walker() override;
|
||||
virtual iteration::walker_base* create_walker() override;
|
||||
|
||||
/**
|
||||
* Returns a grid in the pane.
|
||||
|
|
|
@ -255,7 +255,7 @@ bool pane::disable_click_dismiss() const
|
|||
return false;
|
||||
}
|
||||
|
||||
iterator::walker_base* pane::create_walker()
|
||||
iteration::walker_base* pane::create_walker()
|
||||
{
|
||||
/**
|
||||
* @todo Implement properly.
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
bool disable_click_dismiss() const override;
|
||||
|
||||
/** See @ref widget::create_walker. */
|
||||
virtual iterator::walker_base* create_walker() override;
|
||||
virtual iteration::walker_base* create_walker() override;
|
||||
|
||||
/**
|
||||
* Returns a grid in the pane.
|
||||
|
|
|
@ -143,9 +143,9 @@ public:
|
|||
*
|
||||
* @todo Implement properly.
|
||||
*/
|
||||
virtual iterator::walker_base* create_walker() override
|
||||
virtual iteration::walker_base* create_walker() override
|
||||
{
|
||||
return new gui2::iterator::tree_node(*this, children_);
|
||||
return new gui2::iteration::tree_node(*this, children_);
|
||||
}
|
||||
|
||||
node_children_vector& children()
|
||||
|
|
|
@ -178,7 +178,7 @@ bool viewport::disable_click_dismiss() const
|
|||
return false;
|
||||
}
|
||||
|
||||
iterator::walker_base* viewport::create_walker()
|
||||
iteration::walker_base* viewport::create_walker()
|
||||
{
|
||||
/**
|
||||
* @todo Implement properly.
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
bool disable_click_dismiss() const override;
|
||||
|
||||
/** See @ref widget::create_walker. */
|
||||
virtual iterator::walker_base* create_walker() override;
|
||||
virtual iteration::walker_base* create_walker() override;
|
||||
|
||||
private:
|
||||
widget& widget_;
|
||||
|
|
|
@ -34,10 +34,10 @@ struct builder_widget;
|
|||
namespace dialogs { class modal_dialog; }
|
||||
class window;
|
||||
|
||||
namespace iterator
|
||||
namespace iteration
|
||||
{
|
||||
class walker_base;
|
||||
} // namespace iterator
|
||||
} // namespace iteration
|
||||
|
||||
/**
|
||||
* Base class for all widgets.
|
||||
|
@ -805,7 +805,7 @@ public:
|
|||
virtual bool disable_click_dismiss() const = 0;
|
||||
|
||||
/** Creates a new walker object on the heap. */
|
||||
virtual iterator::walker_base* create_walker() = 0;
|
||||
virtual iteration::walker_base* create_walker() = 0;
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
|
|
@ -126,7 +126,7 @@ static void test_control()
|
|||
T control;
|
||||
|
||||
{
|
||||
gui2::iterator::iterator< gui2::iterator::policy::order::top_down<
|
||||
gui2::iteration::iterator< gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
|
@ -146,7 +146,7 @@ static void test_control()
|
|||
|
||||
}
|
||||
{
|
||||
gui2::iterator::iterator< gui2::iterator::policy::order::top_down<
|
||||
gui2::iteration::iterator< gui2::iteration::policy::order::top_down<
|
||||
false
|
||||
, true
|
||||
, true> >
|
||||
|
@ -158,11 +158,11 @@ static void test_control()
|
|||
}
|
||||
|
||||
{
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::bottom_up<true, true, true> > iterator(control);
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<true, true, true> > iterator(control);
|
||||
BOOST_CHECK_EQUAL(iterator.at_end(), false);
|
||||
}
|
||||
{
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::bottom_up<false, false, false> > iterator(control);
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<false, false, false> > iterator(control);
|
||||
BOOST_CHECK_EQUAL(iterator.at_end(), true);
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ static void test_grid()
|
|||
std::stringstream sstr;
|
||||
lg::redirect_output_setter redirect_output(sstr);
|
||||
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::top_down<
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
|
@ -214,7 +214,7 @@ static void test_grid()
|
|||
std::stringstream sstr;
|
||||
lg::redirect_output_setter redirect_output(sstr);
|
||||
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::top_down<
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::top_down<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
|
@ -230,7 +230,7 @@ static void test_grid()
|
|||
std::stringstream sstr;
|
||||
lg::redirect_output_setter redirect_output(sstr);
|
||||
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::bottom_up<
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
|
@ -246,7 +246,7 @@ static void test_grid()
|
|||
std::stringstream sstr;
|
||||
lg::redirect_output_setter redirect_output(sstr);
|
||||
|
||||
gui2::iterator::iterator<gui2::iterator::policy::order::bottom_up<
|
||||
gui2::iteration::iterator<gui2::iteration::policy::order::bottom_up<
|
||||
true
|
||||
, true
|
||||
, true> >
|
||||
|
|
|
@ -47,37 +47,37 @@ static void test_control()
|
|||
//std::cerr << __func__ << ": " << typeid(T).name() << ".\n";
|
||||
|
||||
T control;
|
||||
const std::unique_ptr<gui2::iterator::walker_base> visitor(control.create_walker());
|
||||
const std::unique_ptr<gui2::iteration::walker_base> visitor(control.create_walker());
|
||||
|
||||
BOOST_REQUIRE_NE(visitor.get(), static_cast<void*>(nullptr));
|
||||
|
||||
/***** INITIAL STATE *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::self), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::internal), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::self), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::internal), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), true);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::self), &control);
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::internal), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::self), &control);
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::internal), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
|
||||
/***** VISITING WIDGET *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::self), gui2::iterator::walker_base::invalid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::internal), gui2::iterator::walker_base::fail);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::fail);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::self), gui2::iteration::walker_base::invalid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::internal), gui2::iteration::walker_base::fail);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::fail);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::self), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::internal), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::self), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::internal), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), true);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::self), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::internal), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::self), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::internal), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
|
||||
/***** POST END *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::self), gui2::iterator::walker_base::fail);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::self), gui2::iteration::walker_base::fail);
|
||||
}
|
||||
|
||||
static void test_control()
|
||||
|
@ -101,53 +101,53 @@ static void test_grid()
|
|||
add_widget(grid, new gui2::label(), "(2,1)", 1, 0);
|
||||
add_widget(grid, new gui2::label(), "(2,2)", 1, 1);
|
||||
|
||||
const std::unique_ptr<gui2::iterator::walker_base> visitor(grid.create_walker());
|
||||
const std::unique_ptr<gui2::iteration::walker_base> visitor(grid.create_walker());
|
||||
|
||||
/***** LABEL 1,1 *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), false);
|
||||
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child)->id(), "(1,1)");
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child)->id(), "(1,1)");
|
||||
|
||||
/***** LABEL 2,1 *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::valid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::valid);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), false);
|
||||
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child)->id(), "(2,1)");
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child)->id(), "(2,1)");
|
||||
|
||||
/***** LABEL 1,2 *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::valid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::valid);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), false);
|
||||
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child)->id(), "(1,2)");
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child)->id(), "(1,2)");
|
||||
|
||||
/***** LABEL 2,2 *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::valid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::valid);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), false);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), false);
|
||||
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child)->id(), "(2,2)");
|
||||
BOOST_REQUIRE_NE(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child)->id(), "(2,2)");
|
||||
|
||||
/***** END *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::invalid);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::invalid);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iterator::walker_base::child), true);
|
||||
BOOST_CHECK_EQUAL(visitor->at_end(gui2::iteration::walker_base::child), true);
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iterator::walker_base::child), static_cast<void*>(nullptr));
|
||||
BOOST_CHECK_EQUAL(visitor->get(gui2::iteration::walker_base::child), static_cast<void*>(nullptr));
|
||||
|
||||
/***** POST END *****/
|
||||
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iterator::walker_base::child), gui2::iterator::walker_base::fail);
|
||||
BOOST_CHECK_EQUAL(visitor->next(gui2::iteration::walker_base::child), gui2::iteration::walker_base::fail);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_gui2_visitor)
|
||||
|
|
Loading…
Add table
Reference in a new issue