Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

country.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL ConimeHotkey (HWND hWnd, HANDLE hConsole, DWORD HotkeyID)
BOOL GetIMEName (PCONSOLE_TABLE ConTbl)
BOOL GetOpenStatusByCodepage (HIMC hIMC, PCONSOLE_TABLE ConTbl)
BOOL ImeUIMakeInfoString (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo)
BOOL MakeInfoStringJapan (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo)
BOOL MakeInfoStringTaiwan (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo)
DWORD MakeStatusStrTaiwan1 (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD MakeStatusStrTaiwan2 (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD IncludeCompositionT (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD IncludeCandidateT (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD DispLenStructedUnicode (PCHAR_INFO lpString, DWORD SrcLength)
BOOL MakeInfoStringPRC (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo)
DWORD MakeStatusStrPRC1 (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD MakeStatusStrPRC2 (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD IncludeCompositionP (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
DWORD IncludeCandidateP (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo, DWORD ModeInfoPtr)
BOOL MakeInfoStringKorea (PCONSOLE_TABLE ConTbl, LPCONIME_UIMODEINFO lpModeInfo)

Variables

WCHAR IMECMode [] = { 0x7121, 0x8907, 0x5358, 0x81ea, 0x9023 }
WCHAR IMECModeRoman [] = { 0xff9b, 0xff70, 0xff8f, 0x0020 }
WCHAR IMECModeKana [] = { 0xff76, 0xff85, 0x0020, 0x0020 }
WCHAR IMECModeAHAN [] = { 0x534a, 0x0041, 0x0020 }
WCHAR IMECModeAZEN [] = { 0x5168, 0xff21 }
WCHAR IMECModeHHAN [] = { 0x534a, 0xff71, 0x0020 }
WCHAR IMECModeHZEN [] = { 0x5168, 0x3042 }
WCHAR IMECModeKHAN [] = { 0x534a, 0xff76, 0x0020 }
WCHAR IMECModeKZEN [] = { 0x5168, 0x30ab }
WCHAR IMECModeFullShape [] = { 0x5168, 0x5f62 }
WCHAR IMECModeHalfShape [] = { 0x534a, 0x5f62 }
WCHAR IMECModeKeyboard [] = { 0x9375, 0x76e4 }
WCHAR IMECModeSymbol [] = { 0x7b26, 0x53f7 }
WCHAR IMECGuide [9][7]


Function Documentation

BOOL ConimeHotkey HWND  hWnd,
HANDLE  hConsole,
DWORD  HotkeyID
 

Definition at line 63 of file country.c.

References DWORD, hWnd, and ImmSimulateHotKey().

Referenced by WndProc().

00068 { 00069 // PCONSOLE_TABLE ConTbl; 00070 // 00071 // ConTbl = SearchConsole(hConsole); 00072 // if (ConTbl == NULL) { 00073 // DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00074 // return FALSE; 00075 // } 00076 00077 return ImmSimulateHotKey(hWnd,(DWORD)HotkeyID); 00078 }

DWORD DispLenStructedUnicode PCHAR_INFO  lpString,
DWORD  SrcLength
 

Definition at line 507 of file country.c.

References DWORD, and IsUnicodeFullWidth().

Referenced by MakeStatusStrPRC2(), and MakeStatusStrTaiwan2().

00511 { 00512 DWORD i; 00513 DWORD Length; 00514 00515 Length = 0; 00516 00517 for ( i = 0; i < SrcLength; i++) { 00518 Length += IsUnicodeFullWidth(lpString[i].Char.UnicodeChar) ? 2 : 1; 00519 } 00520 return Length; 00521 }

BOOL GetIMEName PCONSOLE_TABLE  ConTbl  ) 
 

Definition at line 81 of file country.c.

References DWORD, FALSE, GetKeyboardLayoutName(), _CONSOLE_TABLE::GuideLine, _CONSOLE_TABLE::hIMC_Current, _CONSOLE_TABLE::hklActive, IMECGuide, IMECGuideLen, KBDLAYOUT, KBDLAYOUTTEXT, KBDSEPALATER, _CONSOLE_TABLE::LayoutName, MaxBufSize, NULL, and TRUE.

Referenced by ConImeInputLangchange(), ConsoleSetFocus(), InputLangchange(), and InsertConsole().

00084 { 00085 WCHAR buf[MaxBufSize]; 00086 WCHAR name[MaxBufSize]; 00087 DWORD bufsize = MaxBufSize; 00088 LONG lResult; 00089 HKEY hkLayout; 00090 int i; 00091 00092 ConTbl->LayoutName[0] = TEXT('\0'); 00093 ConTbl->GuideLine[0] = TEXT('\0'); 00094 00095 if (ImmEscape(ConTbl->hklActive, ConTbl->hIMC_Current, IME_ESC_IME_NAME, (LPTSTR)&name) == 0) 00096 { 00097 if (!ImmGetIMEFileName(ConTbl->hklActive, (LPTSTR)&name, MaxBufSize ) ) 00098 { 00099 if (GetKeyboardLayoutName((LPTSTR)&name) ) 00100 { 00101 /* 00102 * quick dirty ImmIsIME 00103 */ 00104 if (name[0] != TEXT('E') && 00105 name[0] != TEXT('e')) 00106 { 00107 return FALSE; 00108 } 00109 00110 lstrcpy( buf, KBDLAYOUT ); 00111 lstrcat( buf, KBDSEPALATER ); 00112 lstrcat( buf, name ); 00113 lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 00114 (LPCTSTR)buf, 00115 0, 00116 KEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS, 00117 &hkLayout ); 00118 if ( lResult == ERROR_SUCCESS ) { 00119 lResult = RegQueryValueEx( hkLayout, 00120 KBDLAYOUTTEXT, 00121 NULL, 00122 NULL, 00123 (LPBYTE)ConTbl->LayoutName, 00124 &bufsize ); 00125 RegCloseKey( hkLayout ); 00126 if (ConTbl->LayoutName[0] != TEXT('\0')) { 00127 for (i = 0; i < 8; i ++){ 00128 if ((ConTbl->LayoutName[0] == IMECGuide[i][0]) && 00129 (ConTbl->LayoutName[1] == IMECGuide[i][1]) ) { 00130 lstrcpyn(&(ConTbl->GuideLine[0]), &(IMECGuide[i][2]), IMECGuideLen+1); 00131 break; 00132 } 00133 } 00134 } 00135 } 00136 else{ 00137 return FALSE; 00138 } 00139 } 00140 else 00141 { 00142 return FALSE; 00143 } 00144 } 00145 else 00146 { 00147 lstrcpy( ConTbl->LayoutName, name ); 00148 } 00149 } 00150 else 00151 { 00152 lstrcpy( ConTbl->LayoutName, name); 00153 } 00154 00155 return TRUE; 00156 }

BOOL GetOpenStatusByCodepage HIMC  hIMC,
PCONSOLE_TABLE  ConTbl
 

Definition at line 159 of file country.c.

References FALSE, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, ImmGetOpenStatus(), ImmIsIME(), LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, and LANG_ID_TAIWAN.

Referenced by GetNLSMode(), and ImeUISetOpenStatus().

00163 { 00164 switch ( HKL_TO_LANGID(ConTbl->hklActive)) 00165 { 00166 case LANG_ID_JAPAN: 00167 return ImmGetOpenStatus(hIMC); 00168 break; 00169 case LANG_ID_TAIWAN: 00170 case LANG_ID_PRC: 00171 case LANG_ID_KOREA: 00172 if (ImmGetOpenStatus(hIMC)) { 00173 return ImmIsIME(ConTbl->hklActive); 00174 } 00175 break; 00176 default: 00177 return FALSE; 00178 } 00179 return FALSE; 00180 }

BOOL ImeUIMakeInfoString PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo
 

Definition at line 183 of file country.c.

References FALSE, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, LANG_ID_TAIWAN, MakeInfoStringJapan(), MakeInfoStringKorea(), MakeInfoStringPRC(), and MakeInfoStringTaiwan().

Referenced by ConImeInputLangchange(), ImeUIOpenStatusWindow(), ImeUISetConversionMode(), and ImeUISetOpenStatus().

00187 { 00188 00189 switch ( HKL_TO_LANGID(ConTbl->hklActive)) 00190 { 00191 case LANG_ID_JAPAN: 00192 return MakeInfoStringJapan(ConTbl, lpModeInfo); 00193 break; 00194 case LANG_ID_TAIWAN: 00195 return MakeInfoStringTaiwan(ConTbl, lpModeInfo); 00196 break; 00197 case LANG_ID_PRC: 00198 return MakeInfoStringPRC(ConTbl, lpModeInfo); 00199 break; 00200 case LANG_ID_KOREA: 00201 return MakeInfoStringKorea(ConTbl, lpModeInfo); 00202 break; 00203 default: 00204 return FALSE; 00205 } 00206 }

DWORD IncludeCandidateP PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 692 of file country.c.

References _CONIME_CANDMESSAGE::AttrOff, _CONIME_UICOMPMESSAGE::CompAttrColor, _CONIME_UICOMPMESSAGE::dwCompStrLen, DWORD, IsUnicodeFullWidth(), _CONSOLE_TABLE::lpCompStrMem, _CONIME_UIMODEINFO::ModeString, NULL, PRCCOMPWIDTH, _CONIME_CANDMESSAGE::String, _CONSOLE_TABLE::SystemLine, UNICODE_COLON, and UNICODE_SPACE.

Referenced by MakeInfoStringPRC().

00697 { 00698 DWORD i; 00699 DWORD j; 00700 DWORD k; 00701 DWORD UnicodeLen; 00702 DWORD dwLength; 00703 PWCHAR TempBuf; 00704 PUCHAR TempBufA; 00705 LPCONIME_CANDMESSAGE SystemLine; 00706 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00707 00708 i = ModeInfoPtr; 00709 if (ConTbl->SystemLine == NULL) { 00710 return i; 00711 } 00712 lpCompStrMem = ConTbl->lpCompStrMem; 00713 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00714 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00715 lpCompStrMem->dwCompStrLen + sizeof(WCHAR)); 00716 00717 k = 0; 00718 UnicodeLen = 0; 00719 for (j = 0; (k < lpCompStrMem->dwCompStrLen )&&(UnicodeLen < PRCCOMPWIDTH); j++, k += sizeof(WCHAR)) { 00720 lpModeInfo->ModeString[i].Char.UnicodeChar = TempBuf[j]; 00721 lpModeInfo->ModeString[i++].Attributes = lpCompStrMem->CompAttrColor[TempBufA[j]]; 00722 UnicodeLen += IsUnicodeFullWidth(TempBuf[j]) ? 2 : 1; 00723 } 00724 00725 for ( j = UnicodeLen; j < PRCCOMPWIDTH; j++) { 00726 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00727 } 00728 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_COLON; 00729 00730 SystemLine = ConTbl->SystemLine; 00731 dwLength = (SystemLine->AttrOff - sizeof(DWORD) ) / sizeof(WCHAR) ; 00732 TempBuf = (PWCHAR)(SystemLine->String); 00733 TempBufA = (PUCHAR)((LPSTR)SystemLine + SystemLine->AttrOff); 00734 00735 for (j = 0; TempBuf[j] != 0; j++ ) { 00736 lpModeInfo->ModeString[i].Char.UnicodeChar = TempBuf[j]; 00737 lpModeInfo->ModeString[i++].Attributes = lpCompStrMem->CompAttrColor[TempBufA[j]]; 00738 } 00739 00740 return i; 00741 }

DWORD IncludeCandidateT PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 474 of file country.c.

References _CONIME_CANDMESSAGE::AttrOff, _CONIME_UICOMPMESSAGE::CompAttrColor, DWORD, _CONSOLE_TABLE::lpCompStrMem, _CONIME_UIMODEINFO::ModeString, NULL, _CONIME_CANDMESSAGE::String, and _CONSOLE_TABLE::SystemLine.

Referenced by MakeInfoStringTaiwan().

00479 { 00480 DWORD i; 00481 DWORD j; 00482 DWORD dwLength; 00483 PWCHAR TempBuf; 00484 PUCHAR TempBufA; 00485 LPCONIME_CANDMESSAGE SystemLine; 00486 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00487 lpCompStrMem = ConTbl->lpCompStrMem; 00488 00489 i = ModeInfoPtr; 00490 if (ConTbl->SystemLine == NULL) { 00491 return i; 00492 } 00493 SystemLine = ConTbl->SystemLine; 00494 dwLength = (SystemLine->AttrOff - sizeof(DWORD) ) / sizeof(WCHAR) ; 00495 TempBuf = (PWCHAR)(SystemLine->String); 00496 TempBufA = (PUCHAR)((LPSTR)SystemLine + SystemLine->AttrOff); 00497 00498 for (j = 0; TempBuf[j] != 0; j++ ) { 00499 lpModeInfo->ModeString[i].Char.UnicodeChar = TempBuf[j]; 00500 lpModeInfo->ModeString[i++].Attributes = lpCompStrMem->CompAttrColor[TempBufA[j]]; 00501 } 00502 00503 return i; 00504 }

DWORD IncludeCompositionP PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 661 of file country.c.

References _CONIME_UICOMPMESSAGE::CompAttrColor, _CONIME_UICOMPMESSAGE::dwCompStrLen, DWORD, _CONSOLE_TABLE::lpCompStrMem, _CONIME_UIMODEINFO::ModeString, and NULL.

Referenced by MakeInfoStringPRC().

00666 { 00667 DWORD i; 00668 DWORD j; 00669 DWORD k; 00670 PWCHAR TempBuf; 00671 PUCHAR TempBufA; 00672 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00673 00674 i = ModeInfoPtr; 00675 if (ConTbl->lpCompStrMem == NULL) { 00676 return i; 00677 } 00678 lpCompStrMem = ConTbl->lpCompStrMem; 00679 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00680 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00681 lpCompStrMem->dwCompStrLen + sizeof(WCHAR)); 00682 00683 k = 0; 00684 for (j = 0; k < lpCompStrMem->dwCompStrLen; j++, k += sizeof(WCHAR)) { 00685 lpModeInfo->ModeString[i].Char.UnicodeChar = TempBuf[j]; 00686 lpModeInfo->ModeString[i++].Attributes = lpCompStrMem->CompAttrColor[TempBufA[j]]; 00687 } 00688 return i; 00689 }

DWORD IncludeCompositionT PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 443 of file country.c.

References _CONIME_UICOMPMESSAGE::CompAttrColor, _CONIME_UICOMPMESSAGE::dwCompStrLen, DWORD, _CONSOLE_TABLE::lpCompStrMem, _CONIME_UIMODEINFO::ModeString, and NULL.

Referenced by MakeInfoStringTaiwan().

00448 { 00449 DWORD i; 00450 DWORD j; 00451 DWORD k; 00452 PWCHAR TempBuf; 00453 PUCHAR TempBufA; 00454 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00455 00456 i = ModeInfoPtr; 00457 if (ConTbl->lpCompStrMem == NULL) { 00458 return i; 00459 } 00460 lpCompStrMem = ConTbl->lpCompStrMem; 00461 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00462 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00463 lpCompStrMem->dwCompStrLen + sizeof(WCHAR)); 00464 00465 k = 0; 00466 for (j = 0; k < lpCompStrMem->dwCompStrLen; j++, k += sizeof(WCHAR)) { 00467 lpModeInfo->ModeString[i].Char.UnicodeChar = TempBuf[j]; 00468 lpModeInfo->ModeString[i++].Attributes = lpCompStrMem->CompAttrColor[TempBufA[j]]; 00469 } 00470 return i; 00471 }

BOOL MakeInfoStringJapan PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo
 

Definition at line 209 of file country.c.

References _CONSOLE_TABLE::dwConversion, DWORD, _CONSOLE_TABLE::dwSentence, _CONSOLE_TABLE::fOpen, GetKeyState(), IMECMode, IMECModeAHAN, IMECModeAHANLen, IMECModeAZEN, IMECModeAZENLen, IMECModeHHAN, IMECModeHHANLen, IMECModeHZEN, IMECModeHZENLen, IMECModeKana, IMECModeKanaLen, IMECModeKHAN, IMECModeKHANLen, IMECModeKZEN, IMECModeKZENLen, IMECModeRoman, IMECModeRomanLen, MODEDISP_AUTO, MODEDISP_NONE, MODEDISP_PHRASE, MODEDISP_PLAURAL, MODEDISP_SINGLE, _CONIME_UIMODEINFO::ModeString, _CONIME_UIMODEINFO::ModeStringLen, _CONIME_UIMODEINFO::Position, TRUE, and VIEW_RIGHT.

Referenced by ImeUIMakeInfoString().

00213 { 00214 int i , j; 00215 DWORD dwConversion; 00216 DWORD dwSentence; 00217 00218 dwConversion = ConTbl->dwConversion; 00219 dwSentence = ConTbl->dwSentence; 00220 00221 i = j = 0; 00222 if (ConTbl->fOpen){ 00223 if (dwConversion & IME_CMODE_FULLSHAPE) { 00224 if (dwConversion & IME_CMODE_NATIVE) { 00225 if (dwConversion & IME_CMODE_KATAKANA) { 00226 for (j = 0; j < IMECModeKZENLen; j++, i++) 00227 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeKZEN[j]; 00228 } 00229 else { 00230 for (j = 0; j < IMECModeHZENLen; j++, i++) 00231 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeHZEN[j]; 00232 } 00233 } 00234 else { 00235 for (j = 0; j < IMECModeAZENLen; j++, i++) 00236 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeAZEN[j]; 00237 } 00238 } 00239 else { 00240 if (dwConversion & IME_CMODE_NATIVE) { 00241 if (dwConversion & IME_CMODE_KATAKANA) { 00242 for (j = 0; j < IMECModeKHANLen; j++, i++) 00243 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeKHAN[j]; 00244 } 00245 else { 00246 for (j = 0; j < IMECModeHHANLen; j++, i++) 00247 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeHHAN[j]; 00248 } 00249 } 00250 else { 00251 for (j = 0; j < IMECModeAHANLen; j++, i++) 00252 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeAHAN[j]; 00253 } 00254 } 00255 00256 if (dwSentence & IME_SMODE_NONE) 00257 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECMode[MODEDISP_NONE]; 00258 else if (dwSentence & IME_SMODE_PLAURALCLAUSE) 00259 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECMode[MODEDISP_PLAURAL]; 00260 else if (dwSentence & IME_SMODE_SINGLECONVERT) 00261 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECMode[MODEDISP_SINGLE]; 00262 else if (dwSentence & IME_SMODE_AUTOMATIC) 00263 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECMode[MODEDISP_AUTO]; 00264 else if (dwSentence & IME_SMODE_PHRASEPREDICT) 00265 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECMode[MODEDISP_PHRASE]; 00266 else { 00267 lpModeInfo->ModeString[i++].Char.UnicodeChar = 0x0020; 00268 lpModeInfo->ModeString[i].Char.UnicodeChar = 0x0020; 00269 } 00270 i++; 00271 00272 if (GetKeyState(VK_KANA) & 1) { 00273 for (j = 0; j < IMECModeKanaLen; j++, i++) 00274 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeKana[j]; 00275 } 00276 else if (dwConversion & IME_CMODE_ROMAN) { 00277 for (j = 0; j < IMECModeRomanLen; j++, i++) 00278 lpModeInfo->ModeString[i].Char.UnicodeChar = IMECModeRoman[j]; 00279 } 00280 } 00281 else { 00282 /* 00283 * In this case, fOpen is 0 (==close). 00284 * Should be fill mode text buffer in console. 00285 * So, console can do fill up that pass to 0 length. 00286 */ 00287 i = 0; 00288 } 00289 for (j = 0; j < i; j++ ) 00290 lpModeInfo->ModeString[j].Attributes = 0x0007; 00291 lpModeInfo->ModeStringLen = i; 00292 lpModeInfo->Position = VIEW_RIGHT; 00293 return TRUE; 00294 }

BOOL MakeInfoStringKorea PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo
 

Definition at line 744 of file country.c.

References _CONIME_UIMODEINFO::ModeString, _CONIME_UIMODEINFO::ModeStringLen, _CONIME_UIMODEINFO::Position, TRUE, UNICODE_SPACE, and VIEW_RIGHT.

Referenced by ImeUIMakeInfoString().

00748 { 00749 int i , j; 00750 00751 i = 0; 00752 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00753 for (j = 0; j < i; j++ ) 00754 lpModeInfo->ModeString[j].Attributes = 0x0007; 00755 lpModeInfo->ModeStringLen = i; 00756 lpModeInfo->Position = VIEW_RIGHT; 00757 return TRUE; 00758 }

BOOL MakeInfoStringPRC PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo
 

Definition at line 525 of file country.c.

References DWORD, _CONSOLE_TABLE::fInCandidate, _CONSOLE_TABLE::fInComposition, _CONSOLE_TABLE::hklActive, ImmIsIME(), IncludeCandidateP(), IncludeCompositionP(), MakeStatusStrPRC1(), MakeStatusStrPRC2(), _CONIME_UIMODEINFO::ModeStringLen, _CONIME_UIMODEINFO::Position, TRUE, and VIEW_LEFT.

Referenced by CloseCandidatePRC(), GetCompStrPRC(), ImeUIMakeInfoString(), OpenCandidatePRC(), and ReDisplayCompStrPRC().

00529 { 00530 DWORD j; 00531 DWORD ModeInfoPtr; 00532 DWORD LengthForDisp; 00533 00534 ModeInfoPtr = 0; 00535 00536 if (ImmIsIME(ConTbl->hklActive) ){ 00537 ModeInfoPtr = MakeStatusStrPRC1(ConTbl, lpModeInfo, ModeInfoPtr); 00538 if (ConTbl->fInComposition) { 00539 if (ConTbl->fInCandidate){ 00540 ModeInfoPtr = IncludeCandidateP(ConTbl, lpModeInfo, ModeInfoPtr); 00541 } 00542 else{ 00543 ModeInfoPtr = IncludeCompositionP(ConTbl, lpModeInfo, ModeInfoPtr); 00544 } 00545 } 00546 ModeInfoPtr = MakeStatusStrPRC2(ConTbl, lpModeInfo, ModeInfoPtr); 00547 } 00548 00549 lpModeInfo->ModeStringLen = ModeInfoPtr; 00550 lpModeInfo->Position = VIEW_LEFT; 00551 return TRUE; 00552 }

BOOL MakeInfoStringTaiwan PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo
 

Definition at line 298 of file country.c.

References DWORD, _CONSOLE_TABLE::fInCandidate, _CONSOLE_TABLE::fInComposition, _CONSOLE_TABLE::hklActive, ImmIsIME(), IncludeCandidateT(), IncludeCompositionT(), MakeStatusStrTaiwan1(), MakeStatusStrTaiwan2(), _CONIME_UIMODEINFO::ModeStringLen, _CONIME_UIMODEINFO::Position, TRUE, and VIEW_LEFT.

Referenced by CloseCandidateTaiwan(), GetCompStrTaiwan(), ImeUIMakeInfoString(), OpenCandidateTaiwan(), and ReDisplayCompStrTaiwan().

00302 { 00303 DWORD j; 00304 DWORD ModeInfoPtr; 00305 DWORD LengthForDisp; 00306 00307 ModeInfoPtr = 0; 00308 00309 if (ImmIsIME(ConTbl->hklActive) ){ 00310 ModeInfoPtr = MakeStatusStrTaiwan1(ConTbl, lpModeInfo, ModeInfoPtr); 00311 if (ConTbl->fInComposition) { 00312 if (ConTbl->fInCandidate){ 00313 ModeInfoPtr = IncludeCandidateT(ConTbl, lpModeInfo, ModeInfoPtr); 00314 } 00315 else{ 00316 ModeInfoPtr = IncludeCompositionT(ConTbl, lpModeInfo, ModeInfoPtr); 00317 } 00318 } 00319 ModeInfoPtr = MakeStatusStrTaiwan2(ConTbl, lpModeInfo, ModeInfoPtr); 00320 } 00321 00322 lpModeInfo->ModeStringLen = ModeInfoPtr; 00323 lpModeInfo->Position = VIEW_LEFT; 00324 return TRUE; 00325 }

DWORD MakeStatusStrPRC1 PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 555 of file country.c.

References _CONSOLE_TABLE::dwConversion, DWORD, IMECModeFullShape, IMECModeFullShapeLen, IMECModeHalfShape, IMECModeHalfShapeLen, IsUnicodeFullWidth(), _CONSOLE_TABLE::LayoutName, _CONIME_UIMODEINFO::ModeString, UNICODE_COLON, and UNICODE_SPACE.

Referenced by MakeInfoStringPRC().

00560 { 00561 DWORD i; 00562 DWORD j; 00563 DWORD dwConversion; 00564 DWORD Length; 00565 00566 dwConversion = ConTbl->dwConversion; 00567 00568 i = ModeInfoPtr; 00569 j = 0; 00570 Length = 0; 00571 while (Length < 9) { 00572 if (ConTbl->LayoutName[j] == 0 ) 00573 break; 00574 if (ConTbl->LayoutName[j] == 0x8f93) 00575 break; 00576 lpModeInfo->ModeString[i].Char.UnicodeChar = ConTbl->LayoutName[j]; 00577 Length += IsUnicodeFullWidth(lpModeInfo->ModeString[i].Char.UnicodeChar) ? 2 : 1; 00578 j++; 00579 i++; 00580 } 00581 if (Length < 9) { 00582 for (j = Length; j < 9; j++ ) { 00583 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00584 } 00585 } 00586 00587 00588 if (dwConversion & IME_CMODE_FULLSHAPE) { 00589 for (j = 0; j < IMECModeFullShapeLen; j++) 00590 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeFullShape[j]; 00591 } 00592 else{ 00593 for (j = 0; j < IMECModeHalfShapeLen; j++) 00594 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeHalfShape[j]; 00595 } 00596 00597 // v-HirShi Oct.14.1996 delete it for get space 00598 // lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00599 00600 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_COLON; 00601 00602 for (j = 0; j < i; j++ ) 00603 lpModeInfo->ModeString[j].Attributes = 0x0007; 00604 return i; 00605 }

DWORD MakeStatusStrPRC2 PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 608 of file country.c.

References DispLenStructedUnicode(), _CONSOLE_TABLE::dwConversion, DWORD, IMECModeKeyboard, IMECModeKeyboardLen, IMECModeSymbol, IMECModeSymbolLen, IsUnicodeFullWidth(), MAXSTATUSCOL, _CONIME_UIMODEINFO::ModeString, _CONSOLE_TABLE::ScreenBufferSize, and UNICODE_SPACE.

Referenced by MakeInfoStringPRC().

00613 { 00614 DWORD LengthOfStr; 00615 DWORD LengthForNum; 00616 DWORD LengthForNum2; 00617 DWORD CountDispWidth; 00618 DWORD StatusWidth; 00619 DWORD i; 00620 DWORD j; 00621 00622 i = ModeInfoPtr; 00623 00624 StatusWidth = ConTbl->ScreenBufferSize.X; 00625 if (StatusWidth > MAXSTATUSCOL) { 00626 StatusWidth = MAXSTATUSCOL; 00627 } 00628 #if defined (CANDCOUNTPRC) //for wider candidate list space v-hirshi Oct.16.1996 00629 LengthOfStr = DispLenStructedUnicode(lpModeInfo->ModeString,ModeInfoPtr) + 1 + 4; 00630 #else 00631 LengthOfStr = DispLenStructedUnicode(lpModeInfo->ModeString,ModeInfoPtr); 00632 #endif 00633 00634 if (LengthOfStr > StatusWidth) { 00635 for ( ; LengthOfStr > StatusWidth; i-- ) { 00636 LengthOfStr -= (IsUnicodeFullWidth(lpModeInfo->ModeString[i].Char.UnicodeChar) ? 2 : 1 ); 00637 } 00638 } 00639 for (j = 0; j < (StatusWidth - LengthOfStr); j++) { 00640 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00641 } 00642 #if defined (CANDCOUNTPRC) //for wider candidate list space v-hirshi Oct.16.1996 00643 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00644 00645 if (ConTbl->dwConversion & IME_CMODE_SYMBOL) { 00646 for (j = 0; j < IMECModeSymbolLen; j++) 00647 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeSymbol[j]; 00648 } 00649 else{ 00650 for (j = 0; j < IMECModeKeyboardLen; j++) 00651 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeKeyboard[j]; 00652 } 00653 #endif 00654 00655 for (j = ModeInfoPtr; j < i; j++ ) 00656 lpModeInfo->ModeString[j].Attributes = 0x0007; 00657 return i; 00658 }

DWORD MakeStatusStrTaiwan1 PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 328 of file country.c.

References _CONSOLE_TABLE::dwConversion, DWORD, _CONSOLE_TABLE::fInCandidate, _CONSOLE_TABLE::GuideLine, IMECGuide, IMECGuideLen, IMECModeFullShape, IMECModeFullShapeLen, IMECModeHalfShape, IMECModeHalfShapeLen, IMECNameLength, IsUnicodeFullWidth(), _CONSOLE_TABLE::LayoutName, _CONIME_UIMODEINFO::ModeString, UNICODE_COLON, and UNICODE_SPACE.

Referenced by MakeInfoStringTaiwan().

00333 { 00334 DWORD i; 00335 DWORD j; 00336 DWORD Length; 00337 DWORD dwConversion; 00338 00339 dwConversion = ConTbl->dwConversion; 00340 00341 i = ModeInfoPtr; 00342 j = 0; 00343 Length = 0; 00344 while (Length < IMECNameLength ) { 00345 if (ConTbl->LayoutName[j] == 0 ) 00346 break; 00347 lpModeInfo->ModeString[i].Char.UnicodeChar = ConTbl->LayoutName[j]; 00348 Length += IsUnicodeFullWidth(lpModeInfo->ModeString[i].Char.UnicodeChar) ? 2 : 1; 00349 j++; 00350 i++; 00351 } 00352 if (Length < IMECNameLength+1) { 00353 for (j = Length; j < IMECNameLength+1; j++ ) { 00354 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00355 } 00356 } 00357 00358 if (dwConversion & IME_CMODE_FULLSHAPE) { 00359 for (j = 0; j < IMECModeFullShapeLen; j++) 00360 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeFullShape[j]; 00361 } 00362 else{ 00363 for (j = 0; j < IMECModeHalfShapeLen; j++) 00364 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeHalfShape[j]; 00365 } 00366 00367 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00368 00369 #if defined (CANDCOUNTPRC) //for wider candidate list space Oct.16.1996 00370 if (ConTbl->fInCandidate){ 00371 for (j = 0; j < IMECGuideLen; j++ ) 00372 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECGuide[8][2+j]; 00373 } 00374 else if (ConTbl->GuideLine[0]){ 00375 for (j = 0; j < IMECGuideLen; j++ ) 00376 lpModeInfo->ModeString[i++].Char.UnicodeChar = ConTbl->GuideLine[j]; 00377 } 00378 #endif 00379 00380 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_COLON; 00381 00382 for (j = 0; j < i; j++ ) 00383 lpModeInfo->ModeString[j].Attributes = 0x0007; 00384 return i; 00385 }

DWORD MakeStatusStrTaiwan2 PCONSOLE_TABLE  ConTbl,
LPCONIME_UIMODEINFO  lpModeInfo,
DWORD  ModeInfoPtr
 

Definition at line 388 of file country.c.

References DispLenStructedUnicode(), _CONSOLE_TABLE::dwConversion, DWORD, IMECModeKeyboard, IMECModeKeyboardLen, IMECModeSymbol, IMECModeSymbolLen, IsUnicodeFullWidth(), MAXSTATUSCOL, _CONIME_UIMODEINFO::ModeString, _CONSOLE_TABLE::ScreenBufferSize, and UNICODE_SPACE.

Referenced by MakeInfoStringTaiwan().

00393 { 00394 DWORD LengthOfStr; 00395 DWORD LengthForNum; 00396 DWORD LengthForNum2; 00397 DWORD CountDispWidth; 00398 DWORD StatusWidth; 00399 DWORD i; 00400 DWORD j; 00401 00402 i = ModeInfoPtr; 00403 00404 StatusWidth = ConTbl->ScreenBufferSize.X; 00405 if (StatusWidth > MAXSTATUSCOL) { 00406 StatusWidth = MAXSTATUSCOL; 00407 } 00408 #if defined (CANDCOUNTCHT) //for wider candidate list space v-hirshi Oct.16.1996 00409 LengthOfStr = DispLenStructedUnicode(lpModeInfo->ModeString,ModeInfoPtr) + 1 + 4; 00410 #else 00411 LengthOfStr = DispLenStructedUnicode(lpModeInfo->ModeString,ModeInfoPtr); 00412 #endif 00413 00414 if (LengthOfStr > StatusWidth) { 00415 for ( ; LengthOfStr > StatusWidth; i-- ) { 00416 LengthOfStr -= (IsUnicodeFullWidth(lpModeInfo->ModeString[i].Char.UnicodeChar) ? 2 : 1 ); 00417 } 00418 } 00419 00420 for (j = 0; j < (StatusWidth - LengthOfStr); j++) { 00421 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00422 } 00423 00424 #if defined (CANDCOUNTCHT) //for wider candidate list space v-hirshi Oct.16.1996 00425 lpModeInfo->ModeString[i++].Char.UnicodeChar = UNICODE_SPACE; 00426 00427 if (ConTbl->dwConversion & IME_CMODE_SYMBOL) { 00428 for (j = 0; j < IMECModeSymbolLen; j++) 00429 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeSymbol[j]; 00430 } 00431 else{ 00432 for (j = 0; j < IMECModeKeyboardLen; j++) 00433 lpModeInfo->ModeString[i++].Char.UnicodeChar = IMECModeKeyboard[j]; 00434 } 00435 #endif 00436 00437 for (j = ModeInfoPtr; j < i; j++ ) 00438 lpModeInfo->ModeString[j].Attributes = 0x0007; 00439 return i; 00440 }


Variable Documentation

WCHAR IMECGuide[9][7]
 

Initial value:

{{ 0x5009, 0x9821, 0x8acb, 0x8f38, 0x5165, 0x5b57, 0x6839 }, { 0x5167, 0x78bc, 0x8acb, 0x8f38, 0x5165, 0x5167, 0x78bc }, { 0x55ae, 0x78bc, 0x8acb, 0x8f38, 0x5165, 0x55ae, 0x78bc }, { 0x901f, 0x6210, 0x8acb, 0x8f38, 0x5165, 0x5b57, 0x6839 }, { 0x5927, 0x6613, 0x8acb, 0x8f38, 0x5165, 0x5b57, 0x6839 }, { 0x82f1, 0x6570, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000 }, { 0xff55, 0xff53, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000 }, { 0x6ce8, 0x97f3, 0x8acb, 0x8f38, 0x5165, 0x7b26, 0x865f }, { 0x6ce8, 0x97f3, 0x8acb, 0x3000, 0x9078, 0x3000, 0x5b57 } }

Definition at line 39 of file country.c.

Referenced by GetIMEName(), and MakeStatusStrTaiwan1().

WCHAR IMECMode[] = { 0x7121, 0x8907, 0x5358, 0x81ea, 0x9023 }
 

Definition at line 24 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeAHAN[] = { 0x534a, 0x0041, 0x0020 }
 

Definition at line 27 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeAZEN[] = { 0x5168, 0xff21 }
 

Definition at line 28 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeFullShape[] = { 0x5168, 0x5f62 }
 

Definition at line 35 of file country.c.

Referenced by MakeStatusStrPRC1(), and MakeStatusStrTaiwan1().

WCHAR IMECModeHalfShape[] = { 0x534a, 0x5f62 }
 

Definition at line 36 of file country.c.

Referenced by MakeStatusStrPRC1(), and MakeStatusStrTaiwan1().

WCHAR IMECModeHHAN[] = { 0x534a, 0xff71, 0x0020 }
 

Definition at line 29 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeHZEN[] = { 0x5168, 0x3042 }
 

Definition at line 30 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeKana[] = { 0xff76, 0xff85, 0x0020, 0x0020 }
 

Definition at line 26 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeKeyboard[] = { 0x9375, 0x76e4 }
 

Definition at line 37 of file country.c.

Referenced by MakeStatusStrPRC2(), and MakeStatusStrTaiwan2().

WCHAR IMECModeKHAN[] = { 0x534a, 0xff76, 0x0020 }
 

Definition at line 31 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeKZEN[] = { 0x5168, 0x30ab }
 

Definition at line 32 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeRoman[] = { 0xff9b, 0xff70, 0xff8f, 0x0020 }
 

Definition at line 25 of file country.c.

Referenced by MakeInfoStringJapan().

WCHAR IMECModeSymbol[] = { 0x7b26, 0x53f7 }
 

Definition at line 38 of file country.c.

Referenced by MakeStatusStrPRC2(), and MakeStatusStrTaiwan2().


Generated on Sat May 15 19:43:17 2004 for test by doxygen 1.3.7