493
507
if ((uSavedCompositionText != _uCompositionText) ||
494
508
memcmp(pszSavedCompositionText, _pszCompositionText, _uCompositionText * sizeof(WCHAR)))
496
wsprintf(GetSharedMemory()->TextValue,L"%s",_pszCompositionText); //@@ Masataka.Shinke
497
GetSharedMemory()->TsfMode=TRUE; //@@ Masataka.Shinke
498
HANDLE hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, EVENT_NAME); //@@ Msataka.Shinke
499
SetEvent(hEvent); //@@ Msataka.Shinke
500
CloseHandle(hEvent); //@@ Msataka.Shinke
510
/////////////////////////////////////////////////////////////
512
if(GetSharedMemory()->TsfMode)
514
wsprintf(GetSharedMemory()->TextValue,L"%s",_pszCompositionText);
515
wsprintf(GetSharedMemory()->OldValue,L"%s",GetSharedMemory()->NewValue);
516
wsprintf(GetSharedMemory()->NewValue,L"%s",GetSharedMemory()->TextValue);
517
wsprintf(GetSharedMemory()->DiffValue,L"%s",Diff(GetSharedMemory()->OldValue,GetSharedMemory()->NewValue,GetSharedMemory()->OldKeyCode,GetSharedMemory()->NewKeyCode));
518
GetSharedMemory()->OldKeyCode=GetSharedMemory()->NewKeyCode;
519
if(GetSharedMemory()->TextValue[0]!=0)
521
wchar_t desktopSpecificNamespace[64];
522
generateDesktopSpecificNamespace(desktopSpecificNamespace,ARRAYSIZE(desktopSpecificNamespace));
524
s<<L"ncalrpc:[NvdaCtlr."<<desktopSpecificNamespace<<L"]";
525
RpcBindingFromStringBinding((RPC_WSTR)(s.str().c_str()),&nvdaControllerBindingHandle);
527
if(nvdajpimeRPC_testIfRunning()==0)
529
nvdajpimeRPC_speakText(GetSharedMemory()->DiffValue);
531
RpcBindingFree(&nvdaControllerBindingHandle);
533
GetSharedMemory()->TsfMode = FALSE;
503
541
if (pszSavedCompositionText)
b'\\ No newline at end of file'
573
WCHAR* CnvdajpimeTSF::Diff(WCHAR* pOld,WCHAR* pNew,UINT pFirstCode,UINT pLastCode)
576
std::wstring Old(pOld);
577
std::wstring New(pNew);
578
std::wstring Dif(L"");
579
WCHAR Ret[256]={NULL};
595
wsprintf(Ret,L"%s",New.c_str());
596
else if(pFirstCode!=pLastCode) //@@
597
wsprintf(Ret,L"%s",New.c_str()); //@@
599
wsprintf(Ret,L"%s",L"");
607
for(int i=(UINT)Old.length()-1,j=(UINT)New.length()-1;(i>=0)*(j>=0);i--,j--) //@@
612
wsprintf(Ret,L"%s",Dif.c_str());
617
if(Old[i-1]!=New[j-1])
620
if( Dif.compare(std::wstring(L"ゃ")) == 0 )
621
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
622
else if (Dif.compare(std::wstring(L"ゅ")) == 0 )
623
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
624
else if (Dif.compare(std::wstring(L"ょ")) == 0 )
625
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
626
else if (Dif.compare(std::wstring(L"ぁ")) == 0 )
627
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
628
else if (Dif.compare(std::wstring(L"ぃ")) == 0 )
629
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
630
else if (Dif.compare(std::wstring(L"ぉ")) == 0 )
631
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
634
else if (Dif.compare(std::wstring(L"ャ")) == 0 )
635
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
636
else if (Dif.compare(std::wstring(L"ュ")) == 0 )
637
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
638
else if (Dif.compare(std::wstring(L"ョ")) == 0 )
639
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
640
else if (Dif.compare(std::wstring(L"ァ")) == 0 )
641
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
642
else if (Dif.compare(std::wstring(L"ィ")) == 0 )
643
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
644
else if (Dif.compare(std::wstring(L"ォ")) == 0 )
645
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
648
else if (Dif.compare(std::wstring(L"ャ")) == 0 )
649
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
650
else if (Dif.compare(std::wstring(L"ュ")) == 0 )
651
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
652
else if (Dif.compare(std::wstring(L"ョ")) == 0 )
653
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
654
else if (Dif.compare(std::wstring(L"ァ")) == 0 )
655
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
656
else if (Dif.compare(std::wstring(L"ィ")) == 0 )
657
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
658
else if (Dif.compare(std::wstring(L"ォ")) == 0 )
659
wsprintf(Ret,L"%s",New.substr(j-1,2).c_str());
670
if(Dif.empty() & (Old.length()<New.length()) )
672
Dif = New[New.length()-1];
673
wsprintf(Ret,L"%s",Dif.c_str());