Esempio n. 1
0
bool tdispatcher::fire(const tevent event, twidget& target)
{
	assert(find<tset_event>(event, tevent_in_set()));
	switch(event) {
		case LEFT_BUTTON_DOUBLE_CLICK:
			return fire_event_double_click<LEFT_BUTTON_CLICK,
										   LEFT_BUTTON_DOUBLE_CLICK,
										   &tevent_executor::
													wants_mouse_left_double_click,
										   tsignal_function>(
					dynamic_cast<twidget*>(this), &target, ttrigger());

		case MIDDLE_BUTTON_DOUBLE_CLICK:
			return fire_event_double_click<MIDDLE_BUTTON_CLICK,
										   MIDDLE_BUTTON_DOUBLE_CLICK,
										   &tevent_executor::
													wants_mouse_middle_double_click,
										   tsignal_function>(
					dynamic_cast<twidget*>(this), &target, ttrigger());

		case RIGHT_BUTTON_DOUBLE_CLICK:
			return fire_event_double_click<RIGHT_BUTTON_CLICK,
										   RIGHT_BUTTON_DOUBLE_CLICK,
										   &tevent_executor::
													wants_mouse_right_double_click,
										   tsignal_function>(
					dynamic_cast<twidget*>(this), &target, ttrigger());

		default:
			return fire_event<tsignal_function>(
					event, dynamic_cast<twidget*>(this), &target, ttrigger());
	}
}
Esempio n. 2
0
bool tdispatcher::fire(const tevent event, twidget& target, tmessage& message)
{
	assert(find<tset_event_message>(event, tevent_in_set()));
	return fire_event<tsignal_message_function>(event,
												dynamic_cast<twidget*>(this),
												&target,
												ttrigger_message(message));
}
Esempio n. 3
0
bool tdispatcher::fire(const tevent event, twidget& target, void*)
{
	assert(find<tset_event_notification>(event, tevent_in_set()));
	return fire_event<tsignal_notification_function>(
			event,
			dynamic_cast<twidget*>(this),
			&target,
			ttrigger_notification());
}
Esempio n. 4
0
bool
tdispatcher::fire(const tevent event, twidget& target, const tpoint& coordinate)
{
	assert(find<tset_event_mouse>(event, tevent_in_set()));
	return fire_event<tsignal_mouse_function>(event,
											  dynamic_cast<twidget*>(this),
											  &target,
											  ttrigger_mouse(coordinate));
}
Esempio n. 5
0
bool tdispatcher::fire(const tevent event
		, twidget& target
		, const SDLKey key
		, const SDLMod modifier
		, const Uint16 unicode)
{
	assert(find<tset_event_keyboard>(event, tevent_in_set()));
	return fire_event<tsignal_keyboard_function>(event
			, dynamic_cast<twidget*>(this)
			, &target
			, ttrigger_keyboard(key, modifier, unicode));
}