diff --git a/repos/gems/include/gems/animator.h b/repos/gems/include/gems/animator.h index 4f4b56bda9..2ebaed4074 100644 --- a/repos/gems/include/gems/animator.h +++ b/repos/gems/include/gems/animator.h @@ -28,7 +28,7 @@ class Animator friend class Item; - Genode::List _items; + Genode::List > _items; public: @@ -41,10 +41,12 @@ class Animator /** * Interface to be implemented by animated objects */ -class Animator::Item : public Genode::List::Element +class Animator::Item { private: + Genode::List_element _element { this }; + Animator &_animator; bool _animated = false; @@ -62,9 +64,9 @@ class Animator::Item : public Genode::List::Element return; if (animated) - _animator._items.insert(this); + _animator._items.insert(&_element); else - _animator._items.remove(this); + _animator._items.remove(&_element); _animated = animated; } @@ -75,9 +77,9 @@ class Animator::Item : public Genode::List::Element inline void Animator::animate() { - for (Item *item = _items.first(); item; ) { - Item *next = item->next(); - item->animate(); + for (Genode::List_element *item = _items.first(); item; ) { + Genode::List_element *next = item->next(); + item->object()->animate(); item = next; } }