コード例 #1
0
void MessageHandler::handleMoSyncMessage(
	Wormhole::MessageStream& message,
	MAWidgetHandle webViewHandle,
	Wormhole::HybridMoblet* moblet)
{
	const char* p = message.getNext();
	const char* logMessage;

	if (0 == strcmp(p, "ExitApplication"))
	{
		// Exit the application.
		moblet->exit();
	}
	else if (0 == strcmp(p, "SendToBackground"))
	{
		maSendToBackground();
	}
	else if (0 == strcmp(p, "SysLog"))
	{
		logMessage = message.getNext();
		maWriteLog(logMessage, strlen(logMessage));
	}
	else if (0 == strcmp(p, "OpenExternalURL"))
	{
		maPlatformRequest(message.getNext());
	}
	else if (0 == strcmp(p, "OpenWormhole"))
	{
		moblet->openWormhole(webViewHandle);
	}
}
コード例 #2
0
	void start()
	{
		// Register focus listener.
		MAUtil::Environment::getEnvironment()
			.addFocusListener(this);

		expect("FocusLost");

		maSendToBackground();
	}