Exemple #1
0
TimedCalls::CallData TimedCalls::Pop()
{
	TimedCalls::CallData call(std::move(m_scheduledCalls.back()));
	m_scheduledCalls.pop_back();
	if (call.interval != Duration::zero())
		Insert(CallData(call.id, call.at + call.interval, call.interval, call.fn));
	return call;
}
Exemple #2
0
bool SpawnProcess( process_t process_ref )
{
  Object*   dest        = process_ref->OperandA();
  Function* constructor = process_ref->OperandB()->function;

  process_t new_process = process_ref->vm->GenerateUniqueProcess();
  process_ref->vm->ExecuteConstructor( CallData(constructor, new_process), process_ref );
  dest->process_ref = new_process;

  return true;
}
/*!
    translate given language tag into static UT_LangRecord stored in
    UT_Language class and set m_pKbdLang to it; do addtional
    processing to ensure the change propagates into the status bar
*/
void XAP_App::setKbdLanguage(const char * pszLang)
{
	if(!pszLang)
	{
		m_pKbdLang = NULL;
	}
	else
	{
		UT_Language Lang;
		m_pKbdLang = Lang.getLangRecordFromCode(pszLang);

		// ensure that the change is shown in our status bar
	    bool bChangeLang = false;
		getPrefsValueBool(XAP_PREF_KEY_ChangeLanguageWithKeyboard, &bChangeLang);

		if(bChangeLang && m_pKbdLang)
		{
			UT_return_if_fail(m_pKbdLang->m_szLangCode);
			
			// invoke appropriate formatting method if it exists
			const EV_EditMethodContainer * pEMC = getEditMethodContainer();

			if(pEMC)
			{
				EV_EditMethod * pEM = pEMC->findEditMethodByName("language");
			
				if (pEM)
				{
					XAP_Frame * pFrame = getLastFocussedFrame();
					
					if(pFrame)
					{
						AV_View * pView = pFrame->getCurrentView();

						if(pView)
						{
							EV_EditMethodCallData CallData(m_pKbdLang->m_szLangCode,
														   strlen(m_pKbdLang->m_szLangCode));

							pEM->Fn(pView,&CallData);
						}
					}
				}
			}
		}
	}
}