本文整理汇总了C++中rocket::core::Event::RemoveReference方法的典型用法代码示例。如果您正苦于以下问题:C++ Event::RemoveReference方法的具体用法?C++ Event::RemoveReference怎么用?C++ Event::RemoveReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rocket::core::Event
的用法示例。
在下文中一共展示了Event::RemoveReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
void UI_ScriptDocument::ProcessEvent( Rocket::Core::Event &event )
{
if( event.GetType() == "afterLoad" && event.GetTargetElement() == this ) {
if( module ) {
owner = event.GetParameter<void *>( "owner", NULL );
as->finishBuilding( module );
as->setModuleUserData( module, owner );
}
isLoading = false;
// handle postponed onload events (HOWTO handle these in cached documents?)
for( PostponedList::iterator it = onloads.begin(); it != onloads.end(); ++it ) {
Rocket::Core::Event *load = *it;
this->DispatchEvent( load->GetType(), *(load->GetParameters()), true );
load->RemoveReference();
}
// and clear the events
onloads.clear();
return;
}
if( event.GetType() == "beforeUnload" && event.GetTargetElement() == this ) {
if( module ) {
// FIXME: destroy script event listeners here somehow!
// destroy the AS module by name to prevent crashes in case multiple document instances share the same module pointer
as->buildReset( GetSourceURL().CString() );
module = NULL;
}
return;
}
if( isLoading ) {
Rocket::Core::Event *instanced = Rocket::Core::Factory::InstanceEvent( event.GetTargetElement(),
event.GetType(), *event.GetParameters(), true );
onloads.push_back( instanced );
event.StopPropagation();
return;
}
Rocket::Core::ElementDocument::ProcessEvent( event );
}