Beispiel #1
0
void RomCommon::RomJSHandler::AddGlobalJSObject(Awesomium::JSObject object)
{
	if(this->IsJSObject(object.remote_id()))
	{
		Logger::getInstance()->Log("RomJSHandler :: Global JS object already registered", LOG_WARNING);
		return;
	}

	this->_globalJSObjectList.push_back(object);
}
		void MethodHandler::BindWithRetval(Awesomium::JSObject &object, const Awesomium::WebString &name, JSDelegateWithRetval callback)
		{
			if (object.type() == Awesomium::kJSObjectType_Local)
			{
				return;
			}

			object.SetCustomMethod(name, true);

			object_method_key_t key(object.remote_id(), name);
			m_bound_methods_with_retval[key] = callback;
		}
		void RootEngine::GUISystem::Dispatcher::BindWithRetVal( Awesomium::JSObject& p_object, const Awesomium::WebString& p_name, JSDelegate1WithRetval p_callback )
		{
			// We can't bind methods to local JSObjects
			if (p_object.type() == Awesomium::kJSObjectType_Local)
			{
				g_context.m_logger->LogText(LogTag::GUI, LogLevel::NON_FATAL_ERROR, "Cannot bind methods to local JSObjects");
				return;
			}

			p_object.SetCustomMethod(p_name, true);

			ObjectMethodKey key(p_object.remote_id(), p_name);
			m_boundMethodsWithRetVal[key] = p_callback;
		}