28#include <forward_list>
38using std::forward_list;
81 return entry.widget.i;
88 return std::find_if (widgets_.begin()
90 , [&](
Attachment const& a) { return a.widget == someWidget; });
98 return widgets_.empty();
110 auto end = widgets_.end();
111 auto pos = findEntry (someWidget);
113 and pos->posX == x_expected
114 and pos->posY == y_expected;
123 widgets_.push_front (
Attachment{elm, xPos,yPos});
129 auto end = widgets_.end();
130 auto pos = findEntry (elm);
148 NOTREACHED (
"Time to pixel translation not covered in this unit test");
187 CHECK (canvas.empty());
189 HookedWidget widget{canvas.hookedAt(1,1)};
190 CHECK (canvas.testVerifyPos (widget, 1,1));
191 CHECK (not canvas.empty());
195 HookedWidget otherWidget{canvas.hookedAt(2,2)};
196 someID = otherWidget.i;
197 CHECK (canvas.testContains (someID));
198 CHECK (canvas.testContains (widget.i));
199 CHECK (canvas.testVerifyPos (widget, 1,1));
200 CHECK (canvas.testVerifyPos (otherWidget, 2,2));
202 CHECK (not canvas.testContains (someID));
203 CHECK (canvas.testContains (widget.i));
204 CHECK (not canvas.empty());
222 HookedWidget w1{canvas.hookedAt(x1,y1)};
223 HookedWidget w3{canvas.hookedAt(x3,y3)};
227 HookedWidget w2{canvas.hookedAt(x2,y2)};
229 CHECK (canvas.testContains (id2));
230 CHECK (canvas.testVerifyPos (w2, x2,y2));
234 w2.moveTo (newX,newY);
236 CHECK (canvas.testVerifyPos (w2, newX,newY));
237 CHECK (canvas.testVerifyPos (w1, x1,y1));
238 CHECK (canvas.testVerifyPos (w3, x3,y3));
240 CHECK (not canvas.testContains (id2));
241 CHECK (canvas.testVerifyPos (w1, x1,y1));
242 CHECK (canvas.testVerifyPos (w3, x3,y3));
Specialised (abstracted) presentation context with positioning by coordinates.
Interface to represent _"some presentation layout entity",_ with the ability to place widgets (manage...
A widget attached onto a display canvas or similar central presentation context.
Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric current...
auto findEntry(DummyWidget const &someWidget)
forward_list< Attachment > widgets_
void hook(DummyWidget &elm, int xPos, int yPos) override
void move(DummyWidget &elm, int xPos, int yPos) override
DisplayMetric & getMetric() const override
access the component to handle layout metric
bool testContains(int someWidgetID)
void remove(DummyWidget &elm) override
auto allWidgetIDs() const
bool testVerifyPos(DummyWidget const &someWidget, int x_expected, int y_expected)
Preconfigured adapters for some STL container standard usage situations.
Building tree expanding and backtracking evaluations within hierarchical scopes.
_SeqT< CON >::Range eachElm(CON &coll)
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
CanvasHooked< DummyWidget > HookedWidget
Lumiera GTK UI implementation root.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
bool contains(MAP &map, typename MAP::key_type const &key)
shortcut for containment test on a map
bool isnil(lib::time::Duration const &dur)
bool linearSearch(IT iter, typename IT::value_type const &val)
use (and exhaust) a »Lumiera Forward Iterator« for linear search
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Managing a collection of non-copyable polymorphic objects in compact storage.
A collection of frequently used helper functions to support unit testing.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...