Contains the implementation details of the find function. More...
Classes | |
struct | find |
Specialized class when itor == end. More... | |
struct | find< false > |
Specialized class when itor != end. More... | |
Functions | |
template<class T > | |
std::vector< std::pair < twidget *, tevent > > | build_event_chain (const tevent event, twidget *dispatcher, twidget *widget) |
Build the event chain. More... | |
template<> | |
std::vector< std::pair < twidget *, tevent > > | build_event_chain< tsignal_notification_function > (const tevent event, twidget *dispatcher, twidget *widget) |
Build the event chain for tsignal_notification_function. More... | |
template<> | |
std::vector< std::pair < twidget *, tevent > > | build_event_chain< tsignal_message_function > (const tevent event, twidget *dispatcher, twidget *widget) |
Build the event chain for tsignal_message_function. More... | |
template<class T , class F > | |
bool | fire_event (const tevent event, std::vector< std::pair< twidget *, tevent > > &event_chain, twidget *dispatcher, twidget *widget, F functor) |
Helper function for fire_event. More... | |
Contains the implementation details of the find function.
|
inline |
Build the event chain.
The event chain is a chain of events starting from the first parent of the widget until (and including) the wanted parent. For all these widgets it will be tested whether they have either a pre or post handler for the event. This ways there will be list of widgets to try to send the events to. If there's no line from widget to parent the result is undefined. (If widget == dispatcher the result will always be empty.)
event | The event to test. |
dispatcher | The final widget to test, this is also the dispatcher the sends the event. |
widget | The widget should parent(s) to check. |
Definition at line 299 of file dispatcher_private.hpp.
References gui2::event::tdispatcher::has_event(), gui2::twidget::parent(), gui2::event::tdispatcher::post, and gui2::event::tdispatcher::pre.
|
inline |
Build the event chain for tsignal_message_function.
This function expects that the widget sending it is also the receiver. This assumption might change, but is valid for now. The function doesn't build an event chain from dispatcher
to widget
but from widget
to its toplevel item (the first one without a parent) which we call window
.
Definition at line 369 of file dispatcher_private.hpp.
References gui2::event::tdispatcher::post, and gui2::event::tdispatcher::pre.
|
inline |
Build the event chain for tsignal_notification_function.
The notification is only send to the receiver it returns an empty chain. Since the pre and post queues are unused, it validates whether they are empty (using asserts).
Definition at line 332 of file dispatcher_private.hpp.
References gui2::event::tdispatcher::post, and gui2::event::tdispatcher::pre.
|
inline |
Helper function for fire_event.
This is called with the same parameters as fire_event except for the event_chain, which contains the widgets with the events to call for them.
Definition at line 404 of file dispatcher_private.hpp.
References gui2::event::tdispatcher::child, gui2::event::tdispatcher::tsignal< T >::child, functor(), gui2::event::tdispatcher::has_event(), itor, gui2::event::tdispatcher::tsignal< T >::post_child, and gui2::event::tdispatcher::tsignal< T >::pre_child.
Referenced by game_lua_kernel::intf_kill(), and game_lua_kernel::intf_select_unit().