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

conimep.h File Reference

Go to the source code of this file.

Classes

struct  _HKL_TABLE
struct  _CONSOLE_TABLE

Defines

#define WINDOWMENU   1
#define ID_CONSOLEIME_ICON   2
#define MM_ABOUT   8001
#define MM_EXIT   8002
#define MM_ACCESS_VIOLATION   8003
#define errTitle   0
#define IDS_MENUNAME   12
#define IDS_APPNAME   13
#define IDS_CLASSNAME   14
#define IDS_TITLE   15
#define IDS_LAST   15
#define DBGPRINT(_params_)
#define CONSOLE_INITIAL_TABLE   10
#define CONSOLE_CONSOLE_TABLE_INCREMENT   5
#define HKL_INITIAL_TABLE   1
#define HKL_TABLE_INCREMENT   1
#define CVMAX   2048
#define NUMMAX   100
#define CMAX   160
#define MAXROW   1
#define MAXCOL   80
#define FIRSTROW   0
#define FIRSTCOL   0
#define LASTROW   (MAXROW-1)
#define LASTCOL   (MAXCOL-1)
#define TABSTOP   8
#define MAX_LISTCAND   32
#define MAX_CHARS_PER_LINE   10
#define MAX_COMP_STRING_LEN   10
#define DEFAULT_CAND_NUM_PER_PAGE   5
#define X_INDENT   10
#define Y_INDENT   10
#define DELIMITERWIDTH   3
#define DEFAULTCANDTABLE   100
#define DISPCHANGELIMIT   188
#define CODEDISPLEN   7
#define DEFAULT_TEMP_WIDTH   80
#define KEY_TOGGLED   0x01
#define MaxBufSize   256
#define KBDLAYOUT   TEXT("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts")
#define KBDLAYOUTTEXT   TEXT("layout text")
#define KBDSEPALATER   TEXT("\\")
#define LANG_ID_TAIWAN   MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_TRADITIONAL)
#define LANG_ID_JAPAN   MAKELANGID(LANG_JAPANESE,SUBLANG_DEFAULT)
#define LANG_ID_KOREA   MAKELANGID(LANG_KOREAN,SUBLANG_DEFAULT)
#define LANG_ID_PRC   MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED)
#define IPHK_HOTKEY   0x0001
#define IPHK_PROCESSBYIME   0x0002
#define IPHK_CHECKCTRL   0x0004
#define IS_IME_KBDLAYOUT(hkl)   ((HIWORD(HandleToUlong(hkl)) & 0xf000) == 0xe000)
#define HKL_TO_LANGID(hkl)   (LOWORD(HandleToUlong(hkl)))
#define UNICODE_BACKSPACE   ((WCHAR)0x08)
#define UNICODE_BACKSPACE2   ((WCHAR)0x25d8)
#define UNICODE_CARRIAGERETURN   ((WCHAR)0x0d)
#define UNICODE_LINEFEED   ((WCHAR)0x0a)
#define UNICODE_BELL   ((WCHAR)0x07)
#define UNICODE_TAB   ((WCHAR)0x09)
#define UNICODE_SPACE   ((WCHAR)0x20)
#define UNICODE_ZERO   ((WCHAR)'0')
#define UNICODE_SLASH   ((WCHAR)'/')
#define UNICODE_COLON   ((WCHAR)':')
#define UNICODE_LEFT   ((WCHAR)'[')
#define UNICODE_RIGHT   ((WCHAR)']')
#define UNICODE_HEXBASE   ((WCHAR)'7')
#define JAPAN_CODEPAGE   932
#define PRC_CODEPAGE   936
#define KOREA_CODEPAGE   949
#define TAIWAN_CODEPAGE   950
#define PRCCOMPWIDTH   10
#define MODEDISP_NONE   0
#define MODEDISP_PLAURAL   1
#define MODEDISP_SINGLE   2
#define MODEDISP_AUTO   3
#define MODEDISP_PHRASE   4
#define IMECModeRomanLen   4
#define IMECModeKanaLen   4
#define IMECModeAHANLen   3
#define IMECModeAZENLen   2
#define IMECModeHHANLen   3
#define IMECModeHZENLen   2
#define IMECModeKHANLen   3
#define IMECModeKZENLen   2
#define IMECModeFullShapeLen   1
#define IMECModeHalfShapeLen   1
#define IMECModeKeyboardLen   2
#define IMECModeSymbolLen   2
#define IMECGuideLen   5
#define IMECNameLength   4

Typedefs

typedef _HKL_TABLE HKL_TABLE
typedef _HKL_TABLELPHKL_TABLE
typedef _CONSOLE_TABLE CONSOLE_TABLE
typedef _CONSOLE_TABLEPCONSOLE_TABLE

Functions

DWORD ImmCallImeConsoleIME (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam, PUINT puVKey)
BOOL ImmTranslateMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL ImmSetActiveContextConsoleIME (HWND hWnd, BOOL fFlag)
BOOL InitConsoleIME (HINSTANCE hInstance)
LRESULT FAR PASCAL WndProc (HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
VOID ExitList (HWND hWnd)
BOOL InsertConsole (HWND hWnd, HANDLE hConsole, HWND hWndConsole)
BOOL GrowConsoleTable (VOID)
PCONSOLE_TABLE SearchConsole (HANDLE hConsole)
BOOL RemoveConsole (HWND hwnd, HANDLE hConsole)
BOOL RemoveConsoleWorker (HWND hwnd, PCONSOLE_TABLE ConTbl)
BOOL InsertNewConsole (HWND hWnd, HANDLE hConsole, HWND hWndConsole)
BOOL ConsoleSetFocus (HWND hWnd, HANDLE hConsole, HKL hKL)
BOOL ConsoleKillFocus (HWND hWnd, HANDLE hConsole)
BOOL ConsoleScreenBufferSize (HWND hWnd, HANDLE hConsolewParam, COORD ScreenBufferSize)
BOOL ConImeInputLangchangeRequest (HWND hWnd, HANDLE hConsole, HKL hkl, int Direction)
BOOL ConImeInputLangchange (HWND hWnd, HANDLE hConsole, HKL hkl)
LRESULT ConsoleImeSendMessage (HWND hWndConsoleIME, WPARAM wParam, LPARAM lParam)
BOOL InputLangchange (HWND hWnd, DWORD CharSet, HKL hkl)
INT Create (HWND hWnd)
void ImeUIStartComposition (HWND hwnd)
void ImeUIEndComposition (HWND hwnd)
void ImeUIComposition (HWND hwnd, WPARAM wParam, LPARAM CompFlag)
void DisplayCompString (HWND hwnd, int Length, PWCHAR CharBuf, PUCHAR AttrBuf)
void DisplayResultString (HWND hwnd, LPWSTR lpStr)
BOOL ImeUINotify (HWND hwnd, WPARAM wParam, LPARAM lParam)
BOOL IsUnicodeFullWidth (IN WCHAR wch)
BOOL ImeUIOpenStatusWindow (HWND hwnd)
BOOL ImeUIChangeCandidate (HWND hwnd, DWORD lParam)
BOOL ImeUISetOpenStatus (HWND hwnd)
BOOL ImeUISetConversionMode (HWND hwnd)
BOOL ImeUIGuideLine (HWND hwnd)
DWORD GetNLSMode (HWND hWnd, HANDLE hConsole)
BOOL SetNLSMode (HWND hWnd, HANDLE hConsole, DWORD fdwConversion)
VOID CopyDataProcess (HWND hWnd, PCOPYDATASTRUCT CopyData)
BOOL ImeSysPropertyWindow (HWND hWnd, WPARAM wParam, LPARAM lParam)
VOID ImeOpenClose (HWND hWnd, BOOL fFlag)
VOID VirtualKeyHandler (HWND hWnd, UINT wParam, UINT lParam)
VOID CharHandlerFromConsole (HWND hWnd, UINT Message, ULONG wParam, ULONG lParam)
VOID CharHandlerToConsole (HWND hWnd, UINT Message, ULONG wParam, ULONG lParam)
BOOL IsDBCSTrailByte (char *base, char *p)
BOOL ConsoleCodepageChange (HWND hWnd, HANDLE hConsole, BOOL Output, WORD CodePage)
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)
BOOL ImeUIOpenCandidate (HWND hwnd, DWORD lParam, BOOL OpenFlag)
BOOL OpenCandidateJapan (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList, BOOL OpenFlag)
BOOL OpenCandidateTaiwan (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList, BOOL OpenFlag)
BOOL OpenCandidatePRC (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList, BOOL OpenFlag)
BOOL OpenCandidateKorea (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList, BOOL OpenFlag)
DWORD DispLenUnicode (LPWSTR lpString)
DWORD GetSystemLineJ (LPCANDIDATELIST lpCandList, LPWSTR String, LPSTR Attr, DWORD dwLength, DWORD CountDispWidth, PCONSOLE_TABLE FocusedConsole, BOOL EnableCodePoint)
DWORD GetSystemLineT (LPCANDIDATELIST lpCandList, LPWSTR String, LPSTR Attr, DWORD dwLength, DWORD CountDispWidth, PCONSOLE_TABLE FocusedConsole)
DWORD GetSystemLineP (LPCANDIDATELIST lpCandList, LPWSTR String, LPSTR Attr, DWORD dwLength, DWORD CountDispWidth, PCONSOLE_TABLE FocusedConsole)
VOID NumString (LPWSTR StrToWrite, DWORD NumToDisp, DWORD CountDispWidth)
BOOL ImeUICloseCandidate (HWND hwnd, DWORD lParam)
BOOL CloseCandidateJapan (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList)
BOOL CloseCandidateTaiwan (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList)
BOOL CloseCandidatePRC (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList)
BOOL CloseCandidateKorea (HWND hwnd, HIMC hIMC, PCONSOLE_TABLE ConTbl, DWORD CandList)
void GetCompositionStr (HWND hwnd, LPARAM CompFlag, WPARAM CompChar)
void GetCompStrJapan (HWND hwnd, PCONSOLE_TABLE ConTbl, LPARAM CompFlag)
void GetCompStrTaiwan (HWND hwnd, PCONSOLE_TABLE ConTbl, LPARAM CompFlag)
void GetCompStrPRC (HWND hwnd, PCONSOLE_TABLE ConTbl, LPARAM CompFlag)
void GetCompStrKorea (HWND hwnd, PCONSOLE_TABLE ConTbl, LPARAM CompFlag, WPARAM CompChar)
VOID ReDisplayCompositionStr (HWND hwnd)
VOID ReDisplayCompStrJapan (HWND hwnd, PCONSOLE_TABLE ConTbl)
VOID ReDisplayCompStrTaiwan (HWND hwnd, PCONSOLE_TABLE ConTbl)
VOID ReDisplayCompStrPRC (HWND hwnd, PCONSOLE_TABLE ConTbl)
VOID ReDisplayCompStrKorea (HWND hwnd, PCONSOLE_TABLE ConTbl)


Define Documentation

#define CMAX   160
 

Definition at line 53 of file conimep.h.

#define CODEDISPLEN   7
 

Definition at line 70 of file conimep.h.

Referenced by OpenCandidateJapan(), and OpenCandidateKorea().

#define CONSOLE_CONSOLE_TABLE_INCREMENT   5
 

Definition at line 47 of file conimep.h.

Referenced by GrowConsoleTable().

#define CONSOLE_INITIAL_TABLE   10
 

Definition at line 46 of file conimep.h.

Referenced by InitConsoleIME().

#define CVMAX   2048
 

Definition at line 51 of file conimep.h.

Referenced by InitConsoleIME().

#define DBGPRINT _params_   ) 
 

Definition at line 43 of file conimep.h.

#define DEFAULT_CAND_NUM_PER_PAGE   5
 

Definition at line 64 of file conimep.h.

#define DEFAULT_TEMP_WIDTH   80
 

Definition at line 71 of file conimep.h.

Referenced by InsertConsole().

#define DEFAULTCANDTABLE   100
 

Definition at line 68 of file conimep.h.

Referenced by OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), and OpenCandidateTaiwan().

#define DELIMITERWIDTH   3
 

Definition at line 67 of file conimep.h.

Referenced by GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), and OpenCandidateTaiwan().

#define DISPCHANGELIMIT   188
 

Definition at line 69 of file conimep.h.

#define errTitle   0
 

Definition at line 29 of file conimep.h.

#define FIRSTCOL   0
 

Definition at line 57 of file conimep.h.

Referenced by ImeUIComposition(), ImeUIEndComposition(), and ImeUIStartComposition().

#define FIRSTROW   0
 

Definition at line 56 of file conimep.h.

#define HKL_INITIAL_TABLE   1
 

Definition at line 48 of file conimep.h.

Referenced by InsertConsole().

#define HKL_TABLE_INCREMENT   1
 

Definition at line 49 of file conimep.h.

Referenced by ConImeInputLangchange().

#define HKL_TO_LANGID hkl   )     (LOWORD(HandleToUlong(hkl)))
 

Definition at line 150 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), GetImeModeSaver(), GetOpenStatusByCodepage(), ImeUICloseCandidate(), ImeUIMakeInfoString(), ImeUIOpenCandidate(), and ReDisplayCompositionStr().

#define ID_CONSOLEIME_ICON   2
 

Definition at line 18 of file conimep.h.

Referenced by InitConsoleIME().

#define IDS_APPNAME   13
 

Definition at line 31 of file conimep.h.

Referenced by InitConsoleIME().

#define IDS_CLASSNAME   14
 

Definition at line 32 of file conimep.h.

Referenced by InitConsoleIME().

#define IDS_LAST   15
 

Definition at line 35 of file conimep.h.

#define IDS_MENUNAME   12
 

Definition at line 30 of file conimep.h.

Referenced by InitConsoleIME().

#define IDS_TITLE   15
 

Definition at line 33 of file conimep.h.

Referenced by InitConsoleIME().

#define IMECGuideLen   5
 

Definition at line 217 of file conimep.h.

Referenced by GetIMEName(), and MakeStatusStrTaiwan1().

#define IMECModeAHANLen   3
 

Definition at line 205 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeAZENLen   2
 

Definition at line 206 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeFullShapeLen   1
 

Definition at line 213 of file conimep.h.

Referenced by MakeStatusStrPRC1(), MakeStatusStrTaiwan1(), and OpenCandidateTaiwan().

#define IMECModeHalfShapeLen   1
 

Definition at line 214 of file conimep.h.

Referenced by MakeStatusStrPRC1(), and MakeStatusStrTaiwan1().

#define IMECModeHHANLen   3
 

Definition at line 207 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeHZENLen   2
 

Definition at line 208 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeKanaLen   4
 

Definition at line 204 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeKeyboardLen   2
 

Definition at line 215 of file conimep.h.

Referenced by MakeStatusStrPRC2(), and MakeStatusStrTaiwan2().

#define IMECModeKHANLen   3
 

Definition at line 209 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeKZENLen   2
 

Definition at line 210 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeRomanLen   4
 

Definition at line 203 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define IMECModeSymbolLen   2
 

Definition at line 216 of file conimep.h.

Referenced by MakeStatusStrPRC2(), and MakeStatusStrTaiwan2().

#define IMECNameLength   4
 

Definition at line 218 of file conimep.h.

Referenced by MakeStatusStrTaiwan1(), and OpenCandidateTaiwan().

#define IPHK_CHECKCTRL   0x0004
 

Definition at line 147 of file conimep.h.

Referenced by CharHandlerFromConsole().

#define IPHK_HOTKEY   0x0001
 

Definition at line 145 of file conimep.h.

Referenced by CharHandlerFromConsole(), ImmProcessKey(), xxxImmProcessKey(), and xxxScanSysQueue().

#define IPHK_PROCESSBYIME   0x0002
 

Definition at line 146 of file conimep.h.

Referenced by CharHandlerFromConsole(), ImmProcessKey(), and xxxScanSysQueue().

#define IS_IME_KBDLAYOUT hkl   )     ((HIWORD(HandleToUlong(hkl)) & 0xf000) == 0xe000)
 

Definition at line 149 of file conimep.h.

Referenced by CheckValidLayoutName(), ConImeInputLangchange(), ConImeInputLangchangeRequest(), ConsoleWindowProc(), FindOrLoadImeDpi(), GetRemoteKeyboardLayout(), GetServerIMEKeyboardLayout(), ImmFreeLayout(), ImmGetImeInfoEx(), ImmLoadIME(), NtUserSetThreadLayoutHandles(), OpenKeyboardLayoutFile(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmLoadLayout(), xxxImmUnloadLayout(), xxxImmUnloadThreadsLayout(), xxxInternalActivateKeyboardLayout(), and xxxLoadKeyboardLayoutEx().

#define JAPAN_CODEPAGE   932
 

Definition at line 189 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), and GetCompositionStr().

#define KBDLAYOUT   TEXT("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts")
 

Definition at line 76 of file conimep.h.

Referenced by GetIMEName().

#define KBDLAYOUTTEXT   TEXT("layout text")
 

Definition at line 77 of file conimep.h.

Referenced by GetIMEName().

#define KBDSEPALATER   TEXT("\\")
 

Definition at line 78 of file conimep.h.

Referenced by GetIMEName().

#define KEY_TOGGLED   0x01
 

Definition at line 73 of file conimep.h.

Referenced by GetControlKeyState().

#define KOREA_CODEPAGE   949
 

Definition at line 191 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), and GetCompositionStr().

#define LANG_ID_JAPAN   MAKELANGID(LANG_JAPANESE,SUBLANG_DEFAULT)
 

Definition at line 81 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), GetOpenStatusByCodepage(), ImeUICloseCandidate(), ImeUIMakeInfoString(), ImeUIOpenCandidate(), and ReDisplayCompositionStr().

#define LANG_ID_KOREA   MAKELANGID(LANG_KOREAN,SUBLANG_DEFAULT)
 

Definition at line 82 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), GetOpenStatusByCodepage(), ImeUICloseCandidate(), ImeUIMakeInfoString(), ImeUIOpenCandidate(), and ReDisplayCompositionStr().

#define LANG_ID_PRC   MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED)
 

Definition at line 83 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), GetOpenStatusByCodepage(), ImeUICloseCandidate(), ImeUIMakeInfoString(), ImeUIOpenCandidate(), and ReDisplayCompositionStr().

#define LANG_ID_TAIWAN   MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_TRADITIONAL)
 

Definition at line 80 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), GetOpenStatusByCodepage(), ImeUICloseCandidate(), ImeUIMakeInfoString(), ImeUIOpenCandidate(), and ReDisplayCompositionStr().

#define LASTCOL   (MAXCOL-1)
 

Definition at line 59 of file conimep.h.

#define LASTROW   (MAXROW-1)
 

Definition at line 58 of file conimep.h.

#define MAX_CHARS_PER_LINE   10
 

Definition at line 62 of file conimep.h.

#define MAX_COMP_STRING_LEN   10
 

Definition at line 63 of file conimep.h.

#define MAX_LISTCAND   32
 

Definition at line 61 of file conimep.h.

Referenced by CloseCandidateJapan(), CloseCandidateKorea(), CloseCandidatePRC(), CloseCandidateTaiwan(), ExitList(), OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), OpenCandidateTaiwan(), and RemoveConsoleWorker().

#define MaxBufSize   256
 

Definition at line 75 of file conimep.h.

Referenced by GetIMEName().

#define MAXCOL   80
 

Definition at line 55 of file conimep.h.

Referenced by ImeUIComposition(), ImeUIEndComposition(), and ImeUIStartComposition().

#define MAXROW   1
 

Definition at line 54 of file conimep.h.

#define MM_ABOUT   8001
 

Definition at line 23 of file conimep.h.

#define MM_ACCESS_VIOLATION   8003
 

Definition at line 25 of file conimep.h.

Referenced by WndProc().

#define MM_EXIT   8002
 

Definition at line 24 of file conimep.h.

Referenced by WndProc().

#define MODEDISP_AUTO   3
 

Definition at line 199 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define MODEDISP_NONE   0
 

Definition at line 196 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define MODEDISP_PHRASE   4
 

Definition at line 200 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define MODEDISP_PLAURAL   1
 

Definition at line 197 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define MODEDISP_SINGLE   2
 

Definition at line 198 of file conimep.h.

Referenced by MakeInfoStringJapan().

#define NUMMAX   100
 

Definition at line 52 of file conimep.h.

#define PRC_CODEPAGE   936
 

Definition at line 190 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), and GetCompositionStr().

#define PRCCOMPWIDTH   10
 

Definition at line 194 of file conimep.h.

Referenced by IncludeCandidateP(), and OpenCandidatePRC().

#define TABSTOP   8
 

Definition at line 60 of file conimep.h.

Referenced by DT_InitDrawTextInfo().

#define TAIWAN_CODEPAGE   950
 

Definition at line 192 of file conimep.h.

Referenced by ConImeInputLangchangeRequest(), and GetCompositionStr().

#define UNICODE_BACKSPACE   ((WCHAR)0x08)
 

Definition at line 175 of file conimep.h.

Referenced by ProcessCommandNumberInput(), ProcessCookedReadInput(), and WWSB_WriteChars().

#define UNICODE_BACKSPACE2   ((WCHAR)0x25d8)
 

Definition at line 176 of file conimep.h.

Referenced by ProcessCookedReadInput().

#define UNICODE_BELL   ((WCHAR)0x07)
 

Definition at line 179 of file conimep.h.

Referenced by WWSB_WriteChars().

#define UNICODE_CARRIAGERETURN   ((WCHAR)0x0d)
 

Definition at line 177 of file conimep.h.

Referenced by CookedRead(), DoStringPaste(), ECInsertText(), MatchandCopyAlias(), ProcessCommandListInput(), ProcessCommandNumberInput(), ProcessCookedReadInput(), StoreSelection(), WWSB_DoSrvWriteConsole(), and WWSB_WriteChars().

#define UNICODE_COLON   ((WCHAR)':')
 

Definition at line 184 of file conimep.h.

Referenced by GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), IncludeCandidateP(), MakeStatusStrPRC1(), and MakeStatusStrTaiwan1().

#define UNICODE_HEXBASE   ((WCHAR)'7')
 

Definition at line 187 of file conimep.h.

Referenced by GetSystemLineJ().

#define UNICODE_LEFT   ((WCHAR)'[')
 

Definition at line 185 of file conimep.h.

Referenced by GetSystemLineJ().

#define UNICODE_LINEFEED   ((WCHAR)0x0a)
 

Definition at line 178 of file conimep.h.

Referenced by CookedRead(), DoStringPaste(), ECInsertText(), MatchandCopyAlias(), ProcessCommandListInput(), ProcessCookedReadInput(), ReadChars(), StoreSelection(), WWSB_DoSrvWriteConsole(), and WWSB_WriteChars().

#define UNICODE_RIGHT   ((WCHAR)']')
 

Definition at line 186 of file conimep.h.

Referenced by GetSystemLineJ().

#define UNICODE_SLASH   ((WCHAR)'/')
 

Definition at line 183 of file conimep.h.

Referenced by GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), and NumString().

#define UNICODE_SPACE   ((WCHAR)0x20)
 

Definition at line 181 of file conimep.h.

#define UNICODE_TAB   ((WCHAR)0x09)
 

Definition at line 180 of file conimep.h.

#define UNICODE_ZERO   ((WCHAR)'0')
 

Definition at line 182 of file conimep.h.

Referenced by GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), and NumString().

#define WINDOWMENU   1
 

Definition at line 17 of file conimep.h.

#define X_INDENT   10
 

Definition at line 65 of file conimep.h.

#define Y_INDENT   10
 

Definition at line 66 of file conimep.h.


Typedef Documentation

typedef struct _CONSOLE_TABLE CONSOLE_TABLE
 

Referenced by InsertConsole().

typedef struct _HKL_TABLE HKL_TABLE
 

Referenced by ConImeInputLangchange(), and InsertConsole().

typedef struct _HKL_TABLE * LPHKL_TABLE
 

typedef struct _CONSOLE_TABLE * PCONSOLE_TABLE
 

Referenced by GrowConsoleTable(), and InitConsoleIME().


Function Documentation

VOID CharHandlerFromConsole HWND  hWnd,
UINT  Message,
ULONG  wParam,
ULONG  lParam
 

Definition at line 208 of file imefull.c.

References BOOL, CharHandlerToConsole(), CONIME_KEYDATA, DWORD, hWnd, ImmCallImeConsoleIME(), ImmTranslateMessage(), IPHK_CHECKCTRL, IPHK_HOTKEY, IPHK_PROCESSBYIME, NULL, Status, UINT, and VOID().

Referenced by WndProc().

00209 { 00210 UINT TmpMessage ; 00211 DWORD dwImmRet ; 00212 UINT uVKey ; 00213 UINT wParamSave ; 00214 00215 if (HIWORD(wParam) == 0){ 00216 wParamSave = wParam ; 00217 } 00218 else { 00219 if (Message == WM_KEYDOWN +CONIME_KEYDATA || Message == WM_KEYUP +CONIME_KEYDATA || 00220 Message == WM_SYSKEYDOWN+CONIME_KEYDATA || Message == WM_SYSKEYUP+CONIME_KEYDATA){ 00221 wParamSave = 0 ; 00222 } 00223 else if(HIWORD(wParam) > 0x00ff){ 00224 WCHAR WideChar ; 00225 UCHAR MultiChar ; 00226 WideChar = HIWORD(wParam) ; 00227 WideCharToMultiByte(CP_OEMCP, 0, &WideChar, 1, &MultiChar, 1, NULL, NULL) ; 00228 wParamSave = MultiChar ; 00229 } 00230 else { 00231 wParamSave = HIWORD(wParam) ; 00232 } 00233 } 00234 00235 if (HIWORD(lParam) & KF_UP) // KEY_TRANSITION_UP 00236 TmpMessage = WM_KEYUP ; 00237 else 00238 TmpMessage = WM_KEYDOWN ; 00239 00240 00241 // Return Value of ClientImmProcessKeyConsoleIME 00242 // IPHK_HOTKEY 1 - the vkey is IME hotkey 00243 // IPHK_PROCESSBYIME 2 - the vkey is the one that the IME is waiting for 00244 // IPHK_CHECKCTRL 4 - not used by NT IME 00245 dwImmRet = ImmCallImeConsoleIME(hWnd, TmpMessage, wParam, lParam, &uVKey) ; 00246 00247 if ( dwImmRet & IPHK_HOTKEY ) { 00248 // 00249 // if this vkey is the IME hotkey, we won't pass 00250 // it to application or hook procedure. 00251 // This is what Win95 does. [takaok] 00252 // 00253 return ; 00254 } 00255 else if (dwImmRet & IPHK_PROCESSBYIME) { 00256 BOOL Status ; 00257 00258 //3.51 00259 // uVKey = (wParamSave<<8) | uVKey ; 00260 // Status = ClientImmTranslateMessageMain( hWnd,uVKey,lParam); 00261 00262 Status = ImmTranslateMessage(hWnd, TmpMessage, wParam, lParam); 00263 00264 00265 } 00266 else if (dwImmRet & IPHK_CHECKCTRL) { 00267 CharHandlerToConsole( hWnd, Message-CONIME_KEYDATA, wParamSave, lParam); 00268 } 00269 else 00270 { 00271 if ((Message == WM_CHAR +CONIME_KEYDATA)|| 00272 (Message == WM_SYSCHAR+CONIME_KEYDATA)) { 00273 CharHandlerToConsole( hWnd, Message-CONIME_KEYDATA, wParamSave, lParam); 00274 } 00275 else 00276 CharHandlerToConsole( hWnd, Message-CONIME_KEYDATA, wParam, lParam); 00277 } 00278 00279 }

VOID CharHandlerToConsole HWND  hWnd,
UINT  Message,
ULONG  wParam,
ULONG  lParam
 

Definition at line 281 of file imefull.c.

References CONIME_KEYDATA, DBGPRINT, hWnd, _CONSOLE_TABLE::hWndCon, LastConsole, NULL, PostMessage(), SearchConsole(), UNICODE_SPACE, VirtualKeyHandler(), and VOID().

Referenced by CharHandlerFromConsole(), and WndProc().

00282 { 00283 PCONSOLE_TABLE ConTbl; 00284 WORD ch ; 00285 int NumByte = 0 ; 00286 00287 ConTbl = SearchConsole(LastConsole); 00288 if (ConTbl == NULL) { 00289 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00290 return; 00291 } 00292 00293 if (HIWORD(lParam) & KF_UP ) { 00294 PostMessage( ConTbl->hWndCon, 00295 Message+CONIME_KEYDATA, 00296 wParam, 00297 lParam) ; 00298 return ; 00299 } 00300 00301 ch = LOWORD(wParam) ; 00302 if ((ch < UNICODE_SPACE) || 00303 ((ch >= UNICODE_SPACE) && 00304 ((Message == WM_KEYDOWN) || (Message == WM_SYSKEYDOWN) ))) { 00305 #ifdef DEBUG_MODE 00306 VirtualKeyHandler( hWnd, wParam ,lParam) ; 00307 #endif 00308 PostMessage( ConTbl->hWndCon, 00309 Message+CONIME_KEYDATA, 00310 wParam, 00311 lParam) ; 00312 return ; 00313 } 00314 00315 #ifdef DEBUG_MODE 00316 StoreChar( hWnd, ch, 0); 00317 #endif 00318 00319 PostMessage( ConTbl->hWndCon, 00320 Message+CONIME_KEYDATA, 00321 wParam, //*Dest, 00322 lParam) ; 00323 }

BOOL CloseCandidateJapan HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList
 

Definition at line 1253 of file country2.c.

References _CONSOLE_TABLE::CandListMemAllocSize, CI_CONIMECANDINFO, ConsoleImeSendMessage(), DWORD, _CONSOLE_TABLE::hWndCon, _CONSOLE_TABLE::lpCandListMem, MAX_LISTCAND, NULL, and TRUE.

Referenced by ImeUICloseCandidate().

01259 { 01260 DWORD dwIndex; 01261 COPYDATASTRUCT CopyData; 01262 01263 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 01264 if ( CandList & ( 1 << dwIndex ) ) { 01265 if (ConTbl->lpCandListMem[dwIndex] != NULL ) { 01266 LocalFree(ConTbl->lpCandListMem[dwIndex]); 01267 ConTbl->lpCandListMem[dwIndex] = NULL; 01268 ConTbl->CandListMemAllocSize[dwIndex] = 0; 01269 } 01270 } 01271 } 01272 01273 CopyData.dwData = CI_CONIMECANDINFO; 01274 CopyData.cbData = 0; 01275 CopyData.lpData = NULL; 01276 ConsoleImeSendMessage( ConTbl->hWndCon, 01277 (WPARAM)hwnd, 01278 (LPARAM)&CopyData 01279 ); 01280 01281 return TRUE; 01282 }

BOOL CloseCandidateKorea HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList
 

Definition at line 1367 of file country2.c.

References _CONSOLE_TABLE::CandListMemAllocSize, CI_CONIMECANDINFO, ConsoleImeSendMessage(), DWORD, _CONSOLE_TABLE::hWndCon, _CONSOLE_TABLE::lpCandListMem, MAX_LISTCAND, NULL, and TRUE.

Referenced by ImeUICloseCandidate().

01373 { 01374 DWORD dwIndex; 01375 COPYDATASTRUCT CopyData; 01376 01377 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 01378 if ( CandList & ( 1 << dwIndex ) ) { 01379 if (ConTbl->lpCandListMem[dwIndex] != NULL ) { 01380 LocalFree(ConTbl->lpCandListMem[dwIndex]); 01381 ConTbl->lpCandListMem[dwIndex] = NULL; 01382 ConTbl->CandListMemAllocSize[dwIndex] = 0; 01383 } 01384 } 01385 } 01386 01387 CopyData.dwData = CI_CONIMECANDINFO; 01388 CopyData.cbData = 0; 01389 CopyData.lpData = NULL; 01390 ConsoleImeSendMessage( ConTbl->hWndCon, 01391 (WPARAM)hwnd, 01392 (LPARAM)&CopyData 01393 ); 01394 01395 return TRUE; 01396 01397 }

BOOL CloseCandidatePRC HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList
 

Definition at line 1326 of file country2.c.

References _CONSOLE_TABLE::CandListMemAllocSize, CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DWORD, FALSE, _CONSOLE_TABLE::hWndCon, _CONSOLE_TABLE::lpCandListMem, MakeInfoStringPRC(), MAX_LISTCAND, NULL, and TRUE.

Referenced by ImeUICloseCandidate().

01332 { 01333 DWORD dwIndex; 01334 COPYDATASTRUCT CopyData; 01335 LPCONIME_UIMODEINFO lpModeInfo; 01336 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ); 01337 if ( lpModeInfo == NULL) { 01338 return FALSE; 01339 } 01340 01341 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 01342 if ( CandList & ( 1 << dwIndex ) ) { 01343 if (ConTbl->lpCandListMem[dwIndex] != NULL ) { 01344 LocalFree(ConTbl->lpCandListMem[dwIndex]); 01345 ConTbl->lpCandListMem[dwIndex] = NULL; 01346 ConTbl->CandListMemAllocSize[dwIndex] = 0; 01347 } 01348 } 01349 } 01350 01351 CopyData.dwData = CI_CONIMEMODEINFO; 01352 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 01353 CopyData.lpData = lpModeInfo; 01354 if (MakeInfoStringPRC(ConTbl, lpModeInfo) ) { 01355 ConsoleImeSendMessage( ConTbl->hWndCon, 01356 (WPARAM)hwnd, 01357 (LPARAM)&CopyData 01358 ); 01359 } 01360 01361 LocalFree( lpModeInfo ); 01362 return TRUE; 01363 01364 }

BOOL CloseCandidateTaiwan HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList
 

Definition at line 1285 of file country2.c.

References _CONSOLE_TABLE::CandListMemAllocSize, CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DWORD, FALSE, _CONSOLE_TABLE::hWndCon, _CONSOLE_TABLE::lpCandListMem, MakeInfoStringTaiwan(), MAX_LISTCAND, NULL, and TRUE.

Referenced by ImeUICloseCandidate().

01291 { 01292 DWORD dwIndex; 01293 COPYDATASTRUCT CopyData; 01294 LPCONIME_UIMODEINFO lpModeInfo; 01295 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ); 01296 if ( lpModeInfo == NULL) { 01297 return FALSE; 01298 } 01299 01300 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 01301 if ( CandList & ( 1 << dwIndex ) ) { 01302 if (ConTbl->lpCandListMem[dwIndex] != NULL ) { 01303 LocalFree(ConTbl->lpCandListMem[dwIndex]); 01304 ConTbl->lpCandListMem[dwIndex] = NULL; 01305 ConTbl->CandListMemAllocSize[dwIndex] = 0; 01306 } 01307 } 01308 } 01309 01310 CopyData.dwData = CI_CONIMEMODEINFO; 01311 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 01312 CopyData.lpData = lpModeInfo; 01313 if (MakeInfoStringTaiwan(ConTbl, lpModeInfo) ) { 01314 ConsoleImeSendMessage( ConTbl->hWndCon, 01315 (WPARAM)hwnd, 01316 (LPARAM)&CopyData 01317 ); 01318 } 01319 01320 LocalFree( lpModeInfo ); 01321 return TRUE; 01322 01323 }

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 }

BOOL ConImeInputLangchange HWND  hWnd,
HANDLE  hConsole,
HKL  hkl
 

Definition at line 1094 of file ntcon/conime/conime.c.

References ActivateKeyboardLayout, ASSERT, CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONSOLE_TABLE::dwConversion, _HKL_TABLE::dwConversion, FALSE, _CONSOLE_TABLE::fOpen, GetIMEName(), _HKL_TABLE::hkl, HKL_TABLE, HKL_TABLE_INCREMENT, _CONSOLE_TABLE::hklActive, _CONSOLE_TABLE::hklListMax, hWnd, _CONSOLE_TABLE::hWndCon, IME_CMODE_OPEN, ImeUIMakeInfoString(), ImeUIOpenStatusWindow(), ImmGetProperty(), _CONSOLE_TABLE::ImmGetProperty, INT, IS_IME_KBDLAYOUT, LastConsole, LPCONIME_UIMODEINFO, _CONSOLE_TABLE::lphklList, _CONIME_UIMODEINFO::ModeStringLen, NULL, _CONIME_UIMODEINFO::Position, SearchConsole(), SetNLSMode(), TRUE, and VIEW_RIGHT.

Referenced by WndProc().

01099 { 01100 PCONSOLE_TABLE ConTbl; 01101 LPCONIME_UIMODEINFO lpModeInfo; 01102 COPYDATASTRUCT CopyData; 01103 INT counter ; 01104 LPHKL_TABLE lphklListNew ; 01105 01106 ConTbl = SearchConsole(hConsole); 01107 if (ConTbl == NULL) { 01108 // cannot find specified console. 01109 // It might be last console lost focus. 01110 // try Last Console. 01111 ConTbl = SearchConsole(LastConsole); 01112 if (ConTbl == NULL) { 01113 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 01114 return FALSE; 01115 } 01116 } 01117 01118 if (ConTbl->lphklList == NULL) { 01119 return FALSE; 01120 } 01121 01122 if (IS_IME_KBDLAYOUT(ConTbl->hklActive)) { 01123 for (counter = 0 ; counter < ConTbl->hklListMax ;counter ++) 01124 { 01125 if (ConTbl->lphklList[counter].hkl == 0 || ConTbl->lphklList[counter].hkl == ConTbl->hklActive) { 01126 break; 01127 } 01128 } 01129 01130 if (counter >= ConTbl->hklListMax) 01131 { 01132 ASSERT(counter == ConTbl->hklListMax); 01133 // reallocation 01134 lphklListNew = LocalAlloc(LPTR, sizeof(HKL_TABLE) * (ConTbl->hklListMax + HKL_TABLE_INCREMENT) ) ; 01135 if (lphklListNew != NULL) 01136 { 01137 CopyMemory(lphklListNew , ConTbl->lphklList , sizeof(HKL_TABLE) * ConTbl->hklListMax) ; 01138 ConTbl->hklListMax += HKL_TABLE_INCREMENT ; 01139 LocalFree(ConTbl->lphklList); 01140 ConTbl->lphklList = lphklListNew; 01141 } 01142 else { 01143 return FALSE ; 01144 } 01145 } 01146 ASSERT(ConTbl->lphklList != NULL); 01147 ConTbl->lphklList[counter].hkl = ConTbl->hklActive; 01148 ConTbl->lphklList[counter].dwConversion = ConTbl->dwConversion | (ConTbl->fOpen ? IME_CMODE_OPEN : 0) ; 01149 } 01150 01151 ActivateKeyboardLayout(hkl, 0); 01152 ConTbl->hklActive = hkl; 01153 GetIMEName( ConTbl ); 01154 ImeUIOpenStatusWindow(hWnd); 01155 ConTbl->ImmGetProperty = ImmGetProperty(ConTbl->hklActive , IGP_PROPERTY); 01156 01157 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ) ; 01158 if ( lpModeInfo == NULL) { 01159 return FALSE; 01160 } 01161 CopyData.dwData = CI_CONIMEMODEINFO ; 01162 CopyData.cbData = sizeof(CONIME_UIMODEINFO) ; 01163 CopyData.lpData = lpModeInfo ; 01164 01165 if (IS_IME_KBDLAYOUT(hkl)) { 01166 01167 for (counter=0; counter < ConTbl->hklListMax ; counter++) 01168 { 01169 if (ConTbl->lphklList[counter].hkl == hkl) 01170 { 01171 SetNLSMode(hWnd, hConsole,ConTbl->lphklList[counter].dwConversion ) ; 01172 ImeUIOpenStatusWindow(hWnd) ; 01173 if (ImeUIMakeInfoString(ConTbl, 01174 lpModeInfo)) 01175 { 01176 ConsoleImeSendMessage( ConTbl->hWndCon, 01177 (WPARAM)hWnd, 01178 (LPARAM)&CopyData 01179 ) ; 01180 } 01181 } 01182 } 01183 } 01184 else 01185 { 01186 01187 SetNLSMode(hWnd, hConsole,ConTbl->dwConversion & ~IME_CMODE_OPEN ) ; 01188 lpModeInfo->ModeStringLen = 0 ; 01189 lpModeInfo->Position = VIEW_RIGHT ; 01190 ConsoleImeSendMessage( ConTbl->hWndCon, 01191 (WPARAM)hWnd, 01192 (LPARAM)&CopyData 01193 ) ; 01194 } 01195 01196 LocalFree( lpModeInfo ); 01197 01198 return TRUE; 01199 }

BOOL ConImeInputLangchangeRequest HWND  hWnd,
HANDLE  hConsole,
HKL  hkl,
int  Direction
 

Definition at line 1000 of file ntcon/conime/conime.c.

References CM_CONIME_KL_ACTIVATE, CONIME_DIRECT, _CONSOLE_TABLE::ConsoleOutputCP, DBGPRINT, DWORD, FALSE, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, _CONSOLE_TABLE::hWndCon, IS_IME_KBDLAYOUT, JAPAN_CODEPAGE, KOREA_CODEPAGE, LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, LANG_ID_TAIWAN, NULL, PostMessage(), PRC_CODEPAGE, SearchConsole(), TAIWAN_CODEPAGE, and TRUE.

Referenced by WndProc().

01006 { 01007 PCONSOLE_TABLE ConTbl; 01008 int nLayouts; 01009 LPHKL lphkl; 01010 DWORD RequiredLID = 0; 01011 int StartPos; 01012 int CurrentHklPos; 01013 int i; 01014 01015 ConTbl = SearchConsole(hConsole); 01016 if (ConTbl == NULL) { 01017 DBGPRINT(("CONIME: cannot find registered Console\n")); 01018 return FALSE; 01019 } 01020 01021 switch (ConTbl->ConsoleOutputCP) { 01022 case JAPAN_CODEPAGE: 01023 RequiredLID = LANG_ID_JAPAN; 01024 break; 01025 case PRC_CODEPAGE: 01026 RequiredLID = LANG_ID_PRC; 01027 break; 01028 case KOREA_CODEPAGE: 01029 RequiredLID = LANG_ID_KOREA; 01030 break; 01031 case TAIWAN_CODEPAGE: 01032 RequiredLID = LANG_ID_TAIWAN; 01033 break; 01034 default: 01035 break; 01036 } 01037 01038 if ( !IS_IME_KBDLAYOUT(hkl) || 01039 ( HKL_TO_LANGID(hkl) == RequiredLID)) { 01040 return TRUE; 01041 } 01042 if (Direction == CONIME_DIRECT) { 01043 return FALSE; 01044 } 01045 01046 nLayouts = GetKeyboardLayoutList(0, NULL); 01047 if (nLayouts == 0) { 01048 return FALSE; 01049 } 01050 lphkl = LocalAlloc(LPTR, nLayouts * sizeof(HKL)); 01051 if (lphkl == NULL) { 01052 return FALSE; 01053 } 01054 GetKeyboardLayoutList(nLayouts, lphkl); 01055 01056 for (CurrentHklPos = 0; CurrentHklPos < nLayouts; CurrentHklPos++) { 01057 if (ConTbl->hklActive == lphkl[CurrentHklPos] ) { 01058 break; 01059 } 01060 } 01061 if (CurrentHklPos >= nLayouts) { 01062 LocalFree(lphkl); 01063 return FALSE; 01064 } 01065 01066 StartPos = CurrentHklPos; 01067 01068 for (i = 0; i < nLayouts; i++) { 01069 StartPos+=Direction; 01070 if (StartPos < 0) { 01071 StartPos = nLayouts-1; 01072 } 01073 else if (StartPos >= nLayouts) { 01074 StartPos = 0; 01075 } 01076 01077 if ((( HandleToUlong(lphkl[StartPos]) & 0xf0000000) == 0x00000000) || 01078 (( HandleToUlong(lphkl[StartPos]) & 0x0000ffff) == RequiredLID)) { 01079 PostMessage( ConTbl->hWndCon, 01080 CM_CONIME_KL_ACTIVATE, 01081 HandleToUlong(lphkl[StartPos]), 01082 0); 01083 LocalFree(lphkl); 01084 return FALSE; 01085 } 01086 } 01087 01088 LocalFree(lphkl); 01089 return FALSE; 01090 01091 }

BOOL ConsoleCodepageChange HWND  hWnd,
HANDLE  hConsole,
BOOL  Output,
WORD  CodePage
 

Definition at line 720 of file consubs.c.

References _CONSOLE_TABLE::ConsoleCP, _CONSOLE_TABLE::ConsoleOutputCP, DBGPRINT, FALSE, NULL, SearchConsole(), and TRUE.

Referenced by WndProc().

00726 { 00727 PCONSOLE_TABLE ConTbl; 00728 00729 ConTbl = SearchConsole(hConsole); 00730 if (ConTbl == NULL) { 00731 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00732 return FALSE; 00733 } 00734 00735 if (Output) 00736 { 00737 ConTbl->ConsoleOutputCP = CodePage ; 00738 } 00739 else 00740 { 00741 ConTbl->ConsoleCP = CodePage ; 00742 } 00743 return (TRUE) ; 00744 }

LRESULT ConsoleImeSendMessage HWND  hWndConsoleIME,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1227 of file ntcon/conime/conime.c.

References CONIME_SENDMSG_TIMEOUT, FALSE, NULL, SendMessageTimeout(), and TRUE.

Referenced by CloseCandidateJapan(), CloseCandidateKorea(), CloseCandidatePRC(), CloseCandidateTaiwan(), ConImeInputLangchange(), GetCompStrJapan(), GetCompStrKorea(), GetCompStrPRC(), GetCompStrTaiwan(), ImeSysPropertyWindow(), ImeUIGuideLine(), ImeUIOpenStatusWindow(), ImeUISetConversionMode(), ImeUISetOpenStatus(), OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), OpenCandidateTaiwan(), ReDisplayCompStrJapan(), ReDisplayCompStrKorea(), ReDisplayCompStrPRC(), and ReDisplayCompStrTaiwan().

01232 { 01233 LRESULT lResult; 01234 LRESULT fNoTimeout; 01235 01236 if (hWndConsoleIME == NULL) 01237 { 01238 return FALSE; 01239 } 01240 01241 fNoTimeout = SendMessageTimeout(hWndConsoleIME, 01242 WM_COPYDATA, 01243 wParam, 01244 lParam, 01245 SMTO_ABORTIFHUNG | SMTO_NORMAL, 01246 CONIME_SENDMSG_TIMEOUT, 01247 &lResult); 01248 01249 if (fNoTimeout) 01250 { 01251 return TRUE; 01252 } 01253 01254 01255 /* 01256 * ConsoleImeMessagePump give up SendMessage to conime. 01257 * CONIME is hung up. 01258 * probably, consrv also hung up. 01259 */ 01260 KdPrint(("ConsoleImeSendMessage: CONIME_SENDMSG_COUNT is hung up\n")); 01261 01262 return FALSE; 01263 01264 }

BOOL ConsoleKillFocus HWND  hWnd,
HANDLE  hConsole
 

Definition at line 950 of file ntcon/conime/conime.c.

References DBGPRINT, FALSE, gfDoNotKillFocus, ghDefaultIMC, hWnd, ImmAssociateContext(), ImmSetActiveContextConsoleIME(), NULL, SearchConsole(), and TRUE.

Referenced by WndProc().

00954 { 00955 PCONSOLE_TABLE ConTbl; 00956 00957 ConTbl = SearchConsole(hConsole); 00958 if (ConTbl == NULL) { 00959 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00960 return FALSE; 00961 } 00962 00963 if ( gfDoNotKillFocus ){ 00964 gfDoNotKillFocus = FALSE; 00965 } 00966 else{ 00967 //v-hirshi Jun.13.1996 #if defined(LATER_DBCS) // kazum 00968 ImmSetActiveContextConsoleIME(hWnd, FALSE); 00969 //v-hirshi Jun.13.1996 #endif 00970 ImmAssociateContext(hWnd, ghDefaultIMC); 00971 } 00972 00973 #ifdef DEBUG_MODE 00974 DisplayInformation(hWnd, hConsole); 00975 #endif 00976 00977 return TRUE; 00978 }

BOOL ConsoleScreenBufferSize HWND  hWnd,
HANDLE  hConsolewParam,
COORD  ScreenBufferSize
 

Definition at line 981 of file ntcon/conime/conime.c.

References DBGPRINT, FALSE, NULL, _CONSOLE_TABLE::ScreenBufferSize, SearchConsole(), and TRUE.

Referenced by WndProc().

00986 { 00987 PCONSOLE_TABLE ConTbl; 00988 00989 ConTbl = SearchConsole(hConsole); 00990 if (ConTbl == NULL) { 00991 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00992 return FALSE; 00993 } 00994 00995 ConTbl->ScreenBufferSize = ScreenBufferSize; 00996 return TRUE; 00997 }

BOOL ConsoleSetFocus HWND  hWnd,
HANDLE  hConsole,
HKL  hKL
 

Definition at line 903 of file ntcon/conime/conime.c.

References ActivateKeyboardLayout, DBGPRINT, FALSE, GetIMEName(), gfDoNotKillFocus, _CONSOLE_TABLE::hIMC_Current, _CONSOLE_TABLE::hklActive, hWnd, ImeUISetOpenStatus(), ImmAssociateContext(), ImmGetProperty(), _CONSOLE_TABLE::ImmGetProperty, ImmSetActiveContextConsoleIME(), LastConsole, _CONSOLE_TABLE::lpCompStrMem, NULL, ReDisplayCompositionStr(), SearchConsole(), and TRUE.

Referenced by WndProc().

00908 { 00909 PCONSOLE_TABLE ConTbl; 00910 HKL OldhKL; 00911 00912 ConTbl = SearchConsole(hConsole); 00913 if (ConTbl == NULL) { 00914 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00915 return FALSE; 00916 } 00917 00918 if ( gfDoNotKillFocus ){ 00919 gfDoNotKillFocus = FALSE; 00920 } 00921 00922 OldhKL = ConTbl->hklActive ; 00923 ConTbl->hklActive = hKL; 00924 ActivateKeyboardLayout(ConTbl->hklActive, 0); 00925 ImmAssociateContext(hWnd, ConTbl->hIMC_Current); 00926 00927 if (OldhKL == 0) { 00928 GetIMEName( ConTbl ); 00929 ConTbl->ImmGetProperty = ImmGetProperty(ConTbl->hklActive , IGP_PROPERTY); 00930 } 00931 00932 //v-hirshi Jun.13.1996 #if defined(LATER_DBCS) // kazum 00933 ImmSetActiveContextConsoleIME(hWnd, TRUE); 00934 //v-hirshi Jun.13.1996 #endif 00935 00936 LastConsole = hConsole; 00937 00938 #ifdef DEBUG_MODE 00939 DisplayInformation(hWnd, hConsole); 00940 #endif 00941 00942 ImeUISetOpenStatus( hWnd ); 00943 if (ConTbl->lpCompStrMem != NULL) 00944 ReDisplayCompositionStr( hWnd ); 00945 00946 return TRUE; 00947 }

VOID CopyDataProcess HWND  hWnd,
PCOPYDATASTRUCT  CopyData
 

INT Create HWND  hWnd  ) 
 

Definition at line 23 of file consubs.c.

References GetDC, GetSystemMetrics(), ghDefaultIMC, hWnd, ImmGetContext(), ReleaseDC(), and UINT.

Referenced by CmpOpenRegKey(), ExCreateCallback(), IopAppendStringToValueKey(), IopOpenCurrentHwProfileDeviceInstanceKey(), IopOpenOrCreateDeviceInterfaceSubKeys(), IopOpenRegistryKey(), IopOpenRegistryKeyPersist(), and WndProc().

00024 { 00025 ghDefaultIMC = ImmGetContext(hWnd) ; 00026 00027 #ifdef DEBUG_MODE 00028 { 00029 // 00030 // Select fixed pitch system font and get its text metrics 00031 // 00032 00033 HDC hdc; 00034 TEXTMETRIC tm; 00035 WORD patern = 0xA4A4; 00036 SIZE size; 00037 HFONT hfntFixed; // fixed-pitch font 00038 HFONT hfntOld; // default font holder 00039 00040 hdc = GetDC( hWnd ); 00041 hfntFixed = GetStockObject( SYSTEM_FIXED_FONT ); 00042 hfntOld = SelectObject( hdc, hfntFixed ); 00043 GetTextMetrics( hdc, &tm ); 00044 00045 GetTextExtentPoint32( hdc, (LPWSTR)&patern, sizeof(WORD), (LPSIZE) &size ); 00046 cxMetrics = (UINT) size.cx / 2; 00047 cyMetrics = (UINT) size.cy; 00048 ReleaseDC( hWnd, hdc ); 00049 00050 xPos = 0 ; 00051 CaretWidth = GetSystemMetrics( SM_CXBORDER ); 00052 } 00053 #endif 00054 00055 return 0; 00056 00057 }

void DisplayCompString HWND  hwnd,
int  Length,
PWCHAR  CharBuf,
PUCHAR  AttrBuf
 

Referenced by GetCompStrJapan(), and GetCompStrKorea().

void DisplayResultString HWND  hwnd,
LPWSTR  lpStr
 

Referenced by GetCompStrJapan(), and GetCompStrKorea().

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 }

DWORD DispLenUnicode LPWSTR  lpString  ) 
 

Definition at line 790 of file country2.c.

References DWORD, and IsUnicodeFullWidth().

Referenced by GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), and OpenCandidateTaiwan().

00792 { 00793 DWORD i; 00794 DWORD Length; 00795 00796 Length = 0; 00797 00798 for ( i = 0; lpString[i] != 0; i++) { 00799 Length += IsUnicodeFullWidth(lpString[i]) ? 2 : 1; 00800 } 00801 return Length; 00802 }

VOID ExitList HWND  hWnd  ) 
 

Definition at line 611 of file ntcon/conime/conime.c.

References _CONSOLE_TABLE::CandListMemAllocSize, _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::CandSepAllocSize, ConsoleTable, DBGPRINT, dwConsoleThreadId, _CONSOLE_TABLE::Enable, FALSE, ghDefaultIMC, _CONSOLE_TABLE::hConsole, _CONSOLE_TABLE::hIMC_Original, hWnd, ImmAssociateContext(), ImmDestroyContext(), _CONSOLE_TABLE::LateRemove, LockConsoleTable, _CONSOLE_TABLE::lpCandListMem, _CONSOLE_TABLE::lpCompStrMem, MAX_LISTCAND, NULL, NumberOfConsoleTable, TRUE, and UnlockConsoleTable.

Referenced by WndProc().

00614 { 00615 ULONG i ,j; 00616 PCONSOLE_TABLE FocusedConsole; 00617 00618 DBGPRINT(("CONIME:ExitList Processing\n")); 00619 ImmAssociateContext(hWnd,ghDefaultIMC); 00620 00621 LockConsoleTable(); 00622 00623 for (i = 1; i < NumberOfConsoleTable; i++) { 00624 FocusedConsole = ConsoleTable[i]; 00625 if (FocusedConsole != NULL) 00626 { 00627 if (FocusedConsole->hConsole != NULL) { 00628 if (FocusedConsole->Enable) { 00629 ImmDestroyContext(FocusedConsole->hIMC_Original); 00630 if ( FocusedConsole->lpCompStrMem != NULL) { 00631 LocalFree( FocusedConsole->lpCompStrMem ); 00632 FocusedConsole->lpCompStrMem = NULL; 00633 } 00634 for (j = 0; j < MAX_LISTCAND; j++){ 00635 if (FocusedConsole->lpCandListMem[j] != NULL) { 00636 LocalFree(FocusedConsole->lpCandListMem[j]); 00637 FocusedConsole->lpCandListMem[j] = NULL; 00638 FocusedConsole->CandListMemAllocSize[j] = 0; 00639 } 00640 } 00641 if (FocusedConsole->CandSep != NULL) { 00642 LocalFree(FocusedConsole->CandSep); 00643 FocusedConsole->CandSepAllocSize = 0; 00644 } 00645 FocusedConsole->Enable = FALSE; 00646 } 00647 else 00648 FocusedConsole->LateRemove = TRUE; 00649 } 00650 } 00651 } 00652 LocalFree( ConsoleTable ); 00653 UnlockConsoleTable(); 00654 00655 if (dwConsoleThreadId) 00656 { 00657 AttachThreadInput(GetCurrentThreadId(), dwConsoleThreadId, FALSE); 00658 UnregisterConsoleIME(); 00659 dwConsoleThreadId = 0; 00660 } 00661 }

void GetCompositionStr HWND  hwnd,
LPARAM  CompFlag,
WPARAM  CompChar
 

Definition at line 32 of file country3.c.

References _CONSOLE_TABLE::ConsoleOutputCP, DBGPRINT, GetCompStrJapan(), GetCompStrKorea(), GetCompStrPRC(), GetCompStrTaiwan(), JAPAN_CODEPAGE, KOREA_CODEPAGE, LastConsole, NULL, PRC_CODEPAGE, SearchConsole(), and TAIWAN_CODEPAGE.

Referenced by ImeUIComposition().

00037 { 00038 PCONSOLE_TABLE ConTbl; 00039 00040 DBGPRINT(("CONIME: GetCompositionStr\n")); 00041 00042 ConTbl = SearchConsole(LastConsole); 00043 if (ConTbl == NULL) { 00044 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00045 return; 00046 } 00047 00048 switch (ConTbl->ConsoleOutputCP) 00049 { 00050 case JAPAN_CODEPAGE: 00051 GetCompStrJapan(hwnd, ConTbl, CompFlag); 00052 break; 00053 case TAIWAN_CODEPAGE: 00054 GetCompStrTaiwan(hwnd, ConTbl, CompFlag); 00055 break; 00056 case PRC_CODEPAGE: 00057 GetCompStrPRC(hwnd, ConTbl, CompFlag); 00058 break; 00059 case KOREA_CODEPAGE: 00060 GetCompStrKorea(hwnd, ConTbl, CompFlag, CompChar); 00061 break; 00062 default: 00063 break; 00064 } 00065 return; 00066 00067 }

void GetCompStrJapan HWND  hwnd,
PCONSOLE_TABLE  ConTbl,
LPARAM  CompFlag
 

Definition at line 70 of file country3.c.

References BYTE, CI_CONIMECOMPOSITION, _CONIME_UICOMPMESSAGE::CompAttrColor, _CONSOLE_TABLE::CompAttrColor, ConsoleImeSendMessage(), DBGPRINT, DisplayCompString(), DisplayResultString(), _CONIME_UICOMPMESSAGE::dwCompAttrLen, _CONIME_UICOMPMESSAGE::dwCompAttrOffset, _CONIME_UICOMPMESSAGE::dwCompStrLen, _CONIME_UICOMPMESSAGE::dwCompStrOffset, DWORD, _CONIME_UICOMPMESSAGE::dwResultStrLen, _CONIME_UICOMPMESSAGE::dwResultStrOffset, _CONIME_UICOMPMESSAGE::dwSize, FAR, _CONSOLE_TABLE::hWndCon, ImmGetContext(), ImmReleaseContext(), _CONSOLE_TABLE::lpCompStrMem, NULL, and UINT.

Referenced by GetCompositionStr().

00075 { 00076 HIMC hIMC; // Input context handle. 00077 DWORD dwBufLen; // Stogare for len. of composition str 00078 DWORD dwBufLenAttr; 00079 COPYDATASTRUCT CopyData; 00080 DWORD SizeToAlloc; 00081 PWCHAR TempBuf; 00082 PUCHAR TempBufA; 00083 DWORD i; 00084 DWORD CursorPos; 00085 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00086 00087 // 00088 // If fail to get input context handle then do nothing. 00089 // Applications should call ImmGetContext API to get 00090 // input context handle. 00091 // 00092 hIMC = ImmGetContext( hwnd ); 00093 if ( hIMC == 0 ) 00094 return; 00095 00096 if (CompFlag & GCS_COMPSTR) 00097 { 00098 // 00099 // Determines how much memory space to store the composition string. 00100 // Applications should call ImmGetCompositionString with 00101 // GCS_COMPSTR flag on, buffer length zero, to get the bullfer 00102 // length. 00103 // 00104 dwBufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void FAR*)NULL, 0l ); 00105 if ( dwBufLen < 0 ) { 00106 ImmReleaseContext( hwnd, hIMC ); 00107 return; 00108 } 00109 if ( CompFlag & GCS_COMPATTR ) 00110 { 00111 DBGPRINT((" GCS_COMPATTR\n")); 00112 dwBufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR,( void FAR *)NULL, 0l ); 00113 if ( dwBufLenAttr < 0 ) { 00114 dwBufLenAttr = 0; 00115 } 00116 } 00117 else { 00118 dwBufLenAttr = 0; 00119 } 00120 } 00121 else if (CompFlag & GCS_RESULTSTR) 00122 { 00123 // 00124 // Determines how much memory space to store the result string. 00125 // Applications should call ImmGetCompositionString with 00126 // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer 00127 // length. 00128 // 00129 dwBufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR, (void FAR *)NULL, 0l ); 00130 if ( dwBufLen < 0 ) { 00131 ImmReleaseContext( hwnd, hIMC ); 00132 return; 00133 } 00134 dwBufLenAttr = 0; 00135 } 00136 else if (CompFlag == 0) 00137 { 00138 dwBufLen = 0; 00139 dwBufLenAttr = 0; 00140 } 00141 00142 SizeToAlloc = (UINT)( sizeof(CONIME_UICOMPMESSAGE) + 00143 dwBufLen + sizeof(WCHAR) + 00144 dwBufLenAttr + sizeof(BYTE) ); 00145 00146 if ( ConTbl->lpCompStrMem != NULL && 00147 SizeToAlloc > ConTbl->lpCompStrMem->dwSize 00148 ) 00149 { 00150 LocalFree( ConTbl->lpCompStrMem ); 00151 ConTbl->lpCompStrMem = NULL; 00152 } 00153 00154 if (ConTbl->lpCompStrMem == NULL) { 00155 ConTbl->lpCompStrMem = (LPCONIME_UICOMPMESSAGE)LocalAlloc(LPTR, SizeToAlloc ); 00156 if ( ConTbl->lpCompStrMem == NULL) { 00157 ImmReleaseContext( hwnd, hIMC ); 00158 return; 00159 } 00160 ConTbl->lpCompStrMem->dwSize = SizeToAlloc; 00161 } 00162 00163 lpCompStrMem = ConTbl->lpCompStrMem; 00164 RtlZeroMemory(&lpCompStrMem->dwCompAttrLen, 00165 lpCompStrMem->dwSize - sizeof(lpCompStrMem->dwSize) 00166 ); 00167 00168 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00169 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00170 dwBufLen + sizeof(WCHAR)); 00171 00172 CopyMemory(lpCompStrMem->CompAttrColor , ConTbl->CompAttrColor , 8 * sizeof(WCHAR)); 00173 00174 CopyData.dwData = CI_CONIMECOMPOSITION; 00175 CopyData.cbData = lpCompStrMem->dwSize; 00176 CopyData.lpData = lpCompStrMem; 00177 00178 if (CompFlag & GCS_COMPSTR) 00179 { 00180 // 00181 // Reads in the composition string. 00182 // 00183 ImmGetCompositionString( hIMC, GCS_COMPSTR, TempBuf, dwBufLen ); 00184 00185 // 00186 // Null terminated. 00187 // 00188 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00189 00190 // 00191 // If GCS_COMPATTR flag is on, then we need to take care of it. 00192 // 00193 if ( dwBufLenAttr != 0 ) 00194 { 00195 ImmGetCompositionString( hIMC, 00196 GCS_COMPATTR, 00197 TempBufA, 00198 dwBufLenAttr ); 00199 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00200 } 00201 00202 CursorPos = ImmGetCompositionString( hIMC, GCS_CURSORPOS, NULL, 0 ); 00203 if (CursorPos == 0) 00204 TempBufA[ CursorPos ] |= (BYTE)0x20; 00205 else 00206 TempBufA[ CursorPos-1 ] |= (BYTE)0x10; 00207 00208 #ifdef DEBUG_INFO 00209 // 00210 // Display new composition chars. 00211 // 00212 xPos = (UINT)dwBufLen; 00213 xPosLast = (UINT)dwBufLen; 00214 00215 DisplayCompString( hwnd, dwBufLen / sizeof(WCHAR), TempBuf, TempBufA ); 00216 #endif 00217 00218 lpCompStrMem->dwCompStrLen = dwBufLen; 00219 if (lpCompStrMem->dwCompStrLen) 00220 lpCompStrMem->dwCompStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00221 00222 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00223 if (lpCompStrMem->dwCompAttrLen) 00224 lpCompStrMem->dwCompAttrOffset = sizeof(CONIME_UICOMPMESSAGE) + dwBufLen + sizeof(WCHAR); 00225 } 00226 else if (CompFlag & GCS_RESULTSTR) 00227 { 00228 // 00229 // Reads in the result string. 00230 // 00231 ImmGetCompositionString( hIMC, GCS_RESULTSTR, TempBuf, dwBufLen ); 00232 00233 // 00234 // Null terminated. 00235 // 00236 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00237 00238 #ifdef DEBUG_INFO 00239 // 00240 // Displays the result string. 00241 // 00242 DisplayResultString( hwnd, TempBuf ); 00243 #endif 00244 00245 lpCompStrMem->dwResultStrLen = dwBufLen; 00246 if (lpCompStrMem->dwResultStrLen) 00247 lpCompStrMem->dwResultStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00248 } 00249 else if (CompFlag == 0) 00250 { 00251 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00252 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00253 lpCompStrMem->dwResultStrLen = dwBufLen; 00254 lpCompStrMem->dwCompStrLen = dwBufLen; 00255 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00256 } 00257 00258 // 00259 // send character to Console 00260 // 00261 ConsoleImeSendMessage( ConTbl->hWndCon, 00262 (WPARAM)hwnd, 00263 (LPARAM)&CopyData 00264 ); 00265 00266 ImmReleaseContext( hwnd, hIMC ); 00267 00268 }

void GetCompStrKorea HWND  hwnd,
PCONSOLE_TABLE  ConTbl,
LPARAM  CompFlag,
WPARAM  CompChar
 

Definition at line 700 of file country3.c.

References BYTE, CI_CONIMECOMPOSITION, _CONIME_UICOMPMESSAGE::CompAttrColor, _CONSOLE_TABLE::CompAttrColor, ConsoleImeSendMessage(), DBGPRINT, DisplayCompString(), DisplayResultString(), _CONIME_UICOMPMESSAGE::dwCompAttrLen, _CONIME_UICOMPMESSAGE::dwCompAttrOffset, _CONIME_UICOMPMESSAGE::dwCompStrLen, _CONIME_UICOMPMESSAGE::dwCompStrOffset, DWORD, _CONIME_UICOMPMESSAGE::dwResultStrLen, _CONIME_UICOMPMESSAGE::dwResultStrOffset, _CONIME_UICOMPMESSAGE::dwSize, FAR, _CONSOLE_TABLE::hWndCon, ImmGetContext(), ImmReleaseContext(), _CONSOLE_TABLE::lpCompStrMem, NULL, and UINT.

Referenced by GetCompositionStr().

00706 { 00707 HIMC hIMC; // Input context handle. 00708 DWORD dwBufLen; // Stogare for len. of composition str 00709 DWORD dwBufLenAttr; 00710 COPYDATASTRUCT CopyData; 00711 DWORD SizeToAlloc; 00712 PWCHAR TempBuf; 00713 PUCHAR TempBufA; 00714 DWORD i; 00715 DWORD CursorPos; 00716 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00717 00718 // 00719 // If fail to get input context handle then do nothing. 00720 // Applications should call ImmGetContext API to get 00721 // input context handle. 00722 // 00723 hIMC = ImmGetContext( hwnd ); 00724 if ( hIMC == 0 ) 00725 return; 00726 00727 // if (CompFlag & CS_INSERTCHAR) 00728 // { 00729 // dwBufLen = 1; 00730 // dwBufLenAttr = 1; 00731 // } 00732 // else 00733 if (CompFlag & GCS_COMPSTR) 00734 { 00735 // 00736 // Determines how much memory space to store the composition string. 00737 // Applications should call ImmGetCompositionString with 00738 // GCS_COMPSTR flag on, buffer length zero, to get the bullfer 00739 // length. 00740 // 00741 dwBufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void FAR*)NULL, 0l ); 00742 if ( dwBufLen < 0 ) { 00743 ImmReleaseContext( hwnd, hIMC ); 00744 return; 00745 } 00746 if ( CompFlag & GCS_COMPATTR ) 00747 { 00748 DBGPRINT((" GCS_COMPATTR\n")); 00749 dwBufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR,( void FAR *)NULL, 0l ); 00750 if ( dwBufLenAttr < 0 ) { 00751 dwBufLenAttr = 0; 00752 } 00753 } 00754 else { 00755 dwBufLenAttr = dwBufLen; 00756 } 00757 } 00758 else if (CompFlag & GCS_RESULTSTR) 00759 { 00760 // 00761 // Determines how much memory space to store the result string. 00762 // Applications should call ImmGetCompositionString with 00763 // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer 00764 // length. 00765 // 00766 dwBufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR, (void FAR *)NULL, 0l ); 00767 if ( dwBufLen < 0 ) { 00768 ImmReleaseContext( hwnd, hIMC ); 00769 return; 00770 } 00771 dwBufLenAttr = 0; 00772 } 00773 else if (CompFlag == 0) 00774 { 00775 dwBufLen = 0; 00776 dwBufLenAttr = 0; 00777 } 00778 else 00779 { 00780 return; 00781 } 00782 00783 SizeToAlloc = (UINT)( sizeof(CONIME_UICOMPMESSAGE) + 00784 dwBufLen + sizeof(WCHAR) + 00785 dwBufLenAttr + sizeof(BYTE) ); 00786 00787 if ( ConTbl->lpCompStrMem != NULL && 00788 SizeToAlloc > ConTbl->lpCompStrMem->dwSize 00789 ) 00790 { 00791 LocalFree( ConTbl->lpCompStrMem ); 00792 ConTbl->lpCompStrMem = NULL; 00793 } 00794 00795 if (ConTbl->lpCompStrMem == NULL) { 00796 ConTbl->lpCompStrMem = (LPCONIME_UICOMPMESSAGE)LocalAlloc(LPTR, SizeToAlloc ); 00797 if ( ConTbl->lpCompStrMem == NULL) { 00798 ImmReleaseContext( hwnd, hIMC ); 00799 return; 00800 } 00801 ConTbl->lpCompStrMem->dwSize = SizeToAlloc; 00802 } 00803 00804 lpCompStrMem = ConTbl->lpCompStrMem; 00805 RtlZeroMemory(&lpCompStrMem->dwCompAttrLen, 00806 lpCompStrMem->dwSize - sizeof(lpCompStrMem->dwSize) 00807 ); 00808 00809 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00810 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00811 dwBufLen + sizeof(WCHAR)); 00812 00813 CopyMemory(lpCompStrMem->CompAttrColor , ConTbl->CompAttrColor , 8 * sizeof(WCHAR)); 00814 00815 CopyData.dwData = CI_CONIMECOMPOSITION; 00816 CopyData.cbData = lpCompStrMem->dwSize; 00817 CopyData.lpData = lpCompStrMem; 00818 00819 if (CompFlag & CS_INSERTCHAR) 00820 { 00821 *TempBuf = (WORD)CompChar; 00822 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00823 *TempBufA = (BYTE)ATTR_TARGET_CONVERTED; 00824 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00825 } 00826 else if (CompFlag & GCS_COMPSTR) 00827 { 00828 // 00829 // Reads in the composition string. 00830 // 00831 ImmGetCompositionString( hIMC, GCS_COMPSTR, TempBuf, dwBufLen ); 00832 00833 // 00834 // Null terminated. 00835 // 00836 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00837 00838 // 00839 // If GCS_COMPATTR flag is on, then we need to take care of it. 00840 // 00841 if ( dwBufLenAttr != 0 ) 00842 { 00843 if ( CompFlag & GCS_COMPATTR ) 00844 { 00845 ImmGetCompositionString( hIMC, 00846 GCS_COMPATTR, 00847 TempBufA, 00848 dwBufLenAttr ); 00849 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00850 } 00851 else 00852 { 00853 for (i = 0; i <= dwBufLenAttr; i++) 00854 TempBufA[ i ] = (BYTE)1; 00855 } 00856 } 00857 00858 // Korean NT does not need IME cursor. v-hirshi 00859 // CursorPos = ImmGetCompositionString( hIMC, GCS_CURSORPOS, NULL, 0 ); 00860 // if (CursorPos == 0) 00861 // TempBufA[ CursorPos ] |= (BYTE)0x20; 00862 // else 00863 // TempBufA[ CursorPos-1 ] |= (BYTE)0x10; 00864 00865 #ifdef DEBUG_INFO 00866 // 00867 // Display new composition chars. 00868 // 00869 xPos = (UINT)dwBufLen; 00870 xPosLast = (UINT)dwBufLen; 00871 00872 DisplayCompString( hwnd, dwBufLen / sizeof(WCHAR), TempBuf, TempBufA ); 00873 #endif 00874 00875 lpCompStrMem->dwCompStrLen = dwBufLen; 00876 if (lpCompStrMem->dwCompStrLen) 00877 lpCompStrMem->dwCompStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00878 00879 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00880 if (lpCompStrMem->dwCompAttrLen) 00881 lpCompStrMem->dwCompAttrOffset = sizeof(CONIME_UICOMPMESSAGE) + dwBufLen + sizeof(WCHAR); 00882 } 00883 else if (CompFlag & GCS_RESULTSTR) 00884 { 00885 // 00886 // Reads in the result string. 00887 // 00888 ImmGetCompositionString( hIMC, GCS_RESULTSTR, TempBuf, dwBufLen ); 00889 00890 // 00891 // Null terminated. 00892 // 00893 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00894 00895 #ifdef DEBUG_INFO 00896 // 00897 // Displays the result string. 00898 // 00899 DisplayResultString( hwnd, TempBuf ); 00900 #endif 00901 00902 lpCompStrMem->dwResultStrLen = dwBufLen; 00903 if (lpCompStrMem->dwResultStrLen) 00904 lpCompStrMem->dwResultStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00905 } 00906 else if (CompFlag == 0) 00907 { 00908 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00909 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00910 lpCompStrMem->dwResultStrLen = dwBufLen; 00911 lpCompStrMem->dwCompStrLen = dwBufLen; 00912 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00913 } 00914 00915 // 00916 // send character to Console 00917 // 00918 ConsoleImeSendMessage( ConTbl->hWndCon, 00919 (WPARAM)hwnd, 00920 (LPARAM)&CopyData 00921 ); 00922 00923 ImmReleaseContext( hwnd, hIMC ); 00924 00925 }

void GetCompStrPRC HWND  hwnd,
PCONSOLE_TABLE  ConTbl,
LPARAM  CompFlag
 

Definition at line 486 of file country3.c.

References BYTE, CI_CONIMECOMPOSITION, CI_CONIMEMODEINFO, _CONIME_UICOMPMESSAGE::CompAttrColor, _CONSOLE_TABLE::CompAttrColor, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONIME_UICOMPMESSAGE::dwCompAttrLen, _CONIME_UICOMPMESSAGE::dwCompAttrOffset, _CONIME_UICOMPMESSAGE::dwCompStrLen, _CONIME_UICOMPMESSAGE::dwCompStrOffset, DWORD, _CONIME_UICOMPMESSAGE::dwResultStrLen, _CONIME_UICOMPMESSAGE::dwResultStrOffset, _CONIME_UICOMPMESSAGE::dwSize, FAR, _CONSOLE_TABLE::hWndCon, ImmGetContext(), ImmReleaseContext(), _CONSOLE_TABLE::lpCompStrMem, MakeInfoStringPRC(), NULL, and UINT.

Referenced by GetCompositionStr().

00491 { 00492 HIMC hIMC; // Input context handle. 00493 DWORD dwBufLen; // Stogare for len. of composition str 00494 DWORD dwBufLenAttr; 00495 DWORD SizeToAlloc; 00496 PWCHAR TempBuf; 00497 PUCHAR TempBufA; 00498 DWORD i; 00499 DWORD CursorPos; 00500 COPYDATASTRUCT CopyData; 00501 LPCONIME_UIMODEINFO lpModeInfo; 00502 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00503 00504 // 00505 // If fail to get input context handle then do nothing. 00506 // Applications should call ImmGetContext API to get 00507 // input context handle. 00508 // 00509 hIMC = ImmGetContext( hwnd ); 00510 if ( hIMC == 0 ) 00511 return; 00512 00513 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ); 00514 if ( lpModeInfo == NULL) { 00515 ImmReleaseContext( hwnd, hIMC ); 00516 return; 00517 } 00518 00519 if (CompFlag & GCS_COMPSTR) 00520 { 00521 // 00522 // Determines how much memory space to store the composition string. 00523 // Applications should call ImmGetCompositionString with 00524 // GCS_COMPSTR flag on, buffer length zero, to get the bullfer 00525 // length. 00526 // 00527 dwBufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void FAR*)NULL, 0l ); 00528 if ( dwBufLen < 0 ) { 00529 ImmReleaseContext( hwnd, hIMC ); 00530 return; 00531 } 00532 if ( CompFlag & GCS_COMPATTR ) 00533 { 00534 DBGPRINT((" GCS_COMPATTR\n")); 00535 dwBufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR,( void FAR *)NULL, 0l ); 00536 if ( dwBufLenAttr < 0 ) { 00537 dwBufLenAttr = 0; 00538 } 00539 } 00540 else { 00541 dwBufLenAttr = 0; 00542 } 00543 } 00544 else if (CompFlag & GCS_RESULTSTR) 00545 { 00546 // 00547 // Determines how much memory space to store the result string. 00548 // Applications should call ImmGetCompositionString with 00549 // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer 00550 // length. 00551 // 00552 dwBufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR, (void FAR *)NULL, 0l ); 00553 if ( dwBufLen < 0 ) { 00554 ImmReleaseContext( hwnd, hIMC ); 00555 return; 00556 } 00557 dwBufLenAttr = 0; 00558 } 00559 else if (CompFlag == 0) 00560 { 00561 dwBufLen = 0; 00562 dwBufLenAttr = 0; 00563 } 00564 00565 SizeToAlloc = (UINT)( sizeof(CONIME_UICOMPMESSAGE) + 00566 dwBufLen + sizeof(WCHAR) + 00567 dwBufLenAttr + sizeof(BYTE) ); 00568 00569 if ( ConTbl->lpCompStrMem != NULL && 00570 SizeToAlloc > ConTbl->lpCompStrMem->dwSize 00571 ) 00572 { 00573 LocalFree( ConTbl->lpCompStrMem ); 00574 ConTbl->lpCompStrMem = NULL; 00575 } 00576 00577 if (ConTbl->lpCompStrMem == NULL) { 00578 ConTbl->lpCompStrMem = (LPCONIME_UICOMPMESSAGE)LocalAlloc(LPTR, SizeToAlloc ); 00579 if ( ConTbl->lpCompStrMem == NULL) { 00580 ImmReleaseContext( hwnd, hIMC ); 00581 return; 00582 } 00583 ConTbl->lpCompStrMem->dwSize = SizeToAlloc; 00584 } 00585 00586 lpCompStrMem = ConTbl->lpCompStrMem; 00587 RtlZeroMemory(&lpCompStrMem->dwCompAttrLen, 00588 lpCompStrMem->dwSize - sizeof(lpCompStrMem->dwSize) 00589 ); 00590 00591 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00592 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00593 dwBufLen + sizeof(WCHAR)); 00594 00595 CopyMemory(lpCompStrMem->CompAttrColor , ConTbl->CompAttrColor , 8 * sizeof(WCHAR)); 00596 00597 if (CompFlag & GCS_COMPSTR) 00598 { 00599 // 00600 // Reads in the composition string. 00601 // 00602 ImmGetCompositionString( hIMC, GCS_COMPSTR, TempBuf, dwBufLen ); 00603 00604 // 00605 // Null terminated. 00606 // 00607 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00608 00609 // 00610 // If GCS_COMPATTR flag is on, then we need to take care of it. 00611 // 00612 if ( dwBufLenAttr != 0 ) 00613 { 00614 ImmGetCompositionString( hIMC, 00615 GCS_COMPATTR, 00616 TempBufA, 00617 dwBufLenAttr ); 00618 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00619 } 00620 00621 lpCompStrMem->dwCompStrLen = dwBufLen; 00622 if (lpCompStrMem->dwCompStrLen) 00623 lpCompStrMem->dwCompStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00624 00625 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00626 if (lpCompStrMem->dwCompAttrLen) 00627 lpCompStrMem->dwCompAttrOffset = sizeof(CONIME_UICOMPMESSAGE) + dwBufLen + sizeof(WCHAR); 00628 // 00629 // Display character to Console 00630 // 00631 CopyData.dwData = CI_CONIMEMODEINFO; 00632 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00633 CopyData.lpData = lpModeInfo; 00634 00635 if (MakeInfoStringPRC(ConTbl, lpModeInfo) ) { 00636 ConsoleImeSendMessage( ConTbl->hWndCon, 00637 (WPARAM)hwnd, 00638 (LPARAM)&CopyData 00639 ); 00640 } 00641 } 00642 else if (CompFlag & GCS_RESULTSTR) 00643 { 00644 // 00645 // Reads in the result string. 00646 // 00647 ImmGetCompositionString( hIMC, GCS_RESULTSTR, TempBuf, dwBufLen ); 00648 00649 // 00650 // Null terminated. 00651 // 00652 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00653 00654 lpCompStrMem->dwResultStrLen = dwBufLen; 00655 if (lpCompStrMem->dwResultStrLen) 00656 lpCompStrMem->dwResultStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00657 // 00658 // send character to Console 00659 // 00660 CopyData.dwData = CI_CONIMECOMPOSITION; 00661 CopyData.cbData = lpCompStrMem->dwSize; 00662 CopyData.lpData = lpCompStrMem; 00663 ConsoleImeSendMessage( ConTbl->hWndCon, 00664 (WPARAM)hwnd, 00665 (LPARAM)&CopyData 00666 ); 00667 00668 } 00669 else if (CompFlag == 0) 00670 { 00671 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00672 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00673 lpCompStrMem->dwResultStrLen = dwBufLen; 00674 lpCompStrMem->dwCompStrLen = dwBufLen; 00675 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00676 // 00677 // Display character to Console 00678 // 00679 CopyData.dwData = CI_CONIMEMODEINFO; 00680 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00681 CopyData.lpData = lpModeInfo; 00682 00683 if (MakeInfoStringPRC(ConTbl, lpModeInfo) ) { 00684 ConsoleImeSendMessage( ConTbl->hWndCon, 00685 (WPARAM)hwnd, 00686 (LPARAM)&CopyData 00687 ); 00688 } 00689 } 00690 00691 00692 LocalFree( lpModeInfo ); 00693 00694 ImmReleaseContext( hwnd, hIMC ); 00695 return; 00696 00697 }

void GetCompStrTaiwan HWND  hwnd,
PCONSOLE_TABLE  ConTbl,
LPARAM  CompFlag
 

Definition at line 272 of file country3.c.

References BYTE, CI_CONIMECOMPOSITION, CI_CONIMEMODEINFO, _CONIME_UICOMPMESSAGE::CompAttrColor, _CONSOLE_TABLE::CompAttrColor, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONIME_UICOMPMESSAGE::dwCompAttrLen, _CONIME_UICOMPMESSAGE::dwCompAttrOffset, _CONIME_UICOMPMESSAGE::dwCompStrLen, _CONIME_UICOMPMESSAGE::dwCompStrOffset, DWORD, _CONIME_UICOMPMESSAGE::dwResultStrLen, _CONIME_UICOMPMESSAGE::dwResultStrOffset, _CONIME_UICOMPMESSAGE::dwSize, FAR, _CONSOLE_TABLE::hWndCon, ImmGetContext(), ImmReleaseContext(), _CONSOLE_TABLE::lpCompStrMem, MakeInfoStringTaiwan(), NULL, and UINT.

Referenced by GetCompositionStr().

00277 { 00278 HIMC hIMC; // Input context handle. 00279 DWORD dwBufLen; // Stogare for len. of composition str 00280 DWORD dwBufLenAttr; 00281 DWORD SizeToAlloc; 00282 PWCHAR TempBuf; 00283 PUCHAR TempBufA; 00284 DWORD i; 00285 DWORD CursorPos; 00286 COPYDATASTRUCT CopyData; 00287 LPCONIME_UIMODEINFO lpModeInfo; 00288 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00289 00290 // 00291 // If fail to get input context handle then do nothing. 00292 // Applications should call ImmGetContext API to get 00293 // input context handle. 00294 // 00295 hIMC = ImmGetContext( hwnd ); 00296 if ( hIMC == 0 ) 00297 return; 00298 00299 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ); 00300 if ( lpModeInfo == NULL) { 00301 ImmReleaseContext( hwnd, hIMC ); 00302 return; 00303 } 00304 00305 if (CompFlag & GCS_COMPSTR) 00306 { 00307 // 00308 // Determines how much memory space to store the composition string. 00309 // Applications should call ImmGetCompositionString with 00310 // GCS_COMPSTR flag on, buffer length zero, to get the bullfer 00311 // length. 00312 // 00313 dwBufLen = ImmGetCompositionString( hIMC, GCS_COMPSTR, (void FAR*)NULL, 0l ); 00314 if ( dwBufLen < 0 ) { 00315 ImmReleaseContext( hwnd, hIMC ); 00316 return; 00317 } 00318 if ( CompFlag & GCS_COMPATTR ) 00319 { 00320 DBGPRINT((" GCS_COMPATTR\n")); 00321 dwBufLenAttr = ImmGetCompositionString( hIMC, GCS_COMPATTR,( void FAR *)NULL, 0l ); 00322 if ( dwBufLenAttr < 0 ) { 00323 dwBufLenAttr = 0; 00324 } 00325 } 00326 else { 00327 dwBufLenAttr = 0; 00328 } 00329 } 00330 else if (CompFlag & GCS_RESULTSTR) 00331 { 00332 // 00333 // Determines how much memory space to store the result string. 00334 // Applications should call ImmGetCompositionString with 00335 // GCS_RESULTSTR flag on, buffer length zero, to get the bullfer 00336 // length. 00337 // 00338 dwBufLen = ImmGetCompositionString( hIMC, GCS_RESULTSTR, (void FAR *)NULL, 0l ); 00339 if ( dwBufLen < 0 ) { 00340 ImmReleaseContext( hwnd, hIMC ); 00341 return; 00342 } 00343 dwBufLenAttr = 0; 00344 } 00345 else if (CompFlag == 0) 00346 { 00347 dwBufLen = 0; 00348 dwBufLenAttr = 0; 00349 } 00350 00351 SizeToAlloc = (UINT)( sizeof(CONIME_UICOMPMESSAGE) + 00352 dwBufLen + sizeof(WCHAR) + 00353 dwBufLenAttr + sizeof(BYTE) ); 00354 00355 if ( ConTbl->lpCompStrMem != NULL && 00356 SizeToAlloc > ConTbl->lpCompStrMem->dwSize 00357 ) 00358 { 00359 LocalFree( ConTbl->lpCompStrMem ); 00360 ConTbl->lpCompStrMem = NULL; 00361 } 00362 00363 if (ConTbl->lpCompStrMem == NULL) { 00364 ConTbl->lpCompStrMem = (LPCONIME_UICOMPMESSAGE)LocalAlloc(LPTR, SizeToAlloc ); 00365 if ( ConTbl->lpCompStrMem == NULL) { 00366 ImmReleaseContext( hwnd, hIMC ); 00367 return; 00368 } 00369 ConTbl->lpCompStrMem->dwSize = SizeToAlloc; 00370 } 00371 00372 lpCompStrMem = ConTbl->lpCompStrMem; 00373 RtlZeroMemory(&lpCompStrMem->dwCompAttrLen, 00374 lpCompStrMem->dwSize - sizeof(lpCompStrMem->dwSize) 00375 ); 00376 00377 TempBuf = (PWCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE)); 00378 TempBufA = (PUCHAR)((PUCHAR)lpCompStrMem + sizeof(CONIME_UICOMPMESSAGE) + 00379 dwBufLen + sizeof(WCHAR)); 00380 00381 CopyMemory(lpCompStrMem->CompAttrColor , ConTbl->CompAttrColor , 8 * sizeof(WCHAR)); 00382 00383 if (CompFlag & GCS_COMPSTR) 00384 { 00385 // 00386 // Reads in the composition string. 00387 // 00388 ImmGetCompositionString( hIMC, GCS_COMPSTR, TempBuf, dwBufLen ); 00389 00390 // 00391 // Null terminated. 00392 // 00393 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00394 00395 // 00396 // If GCS_COMPATTR flag is on, then we need to take care of it. 00397 // 00398 if ( dwBufLenAttr != 0 ) 00399 { 00400 ImmGetCompositionString( hIMC, 00401 GCS_COMPATTR, 00402 TempBufA, 00403 dwBufLenAttr ); 00404 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00405 } 00406 00407 lpCompStrMem->dwCompStrLen = dwBufLen; 00408 if (lpCompStrMem->dwCompStrLen) 00409 lpCompStrMem->dwCompStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00410 00411 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00412 if (lpCompStrMem->dwCompAttrLen) 00413 lpCompStrMem->dwCompAttrOffset = sizeof(CONIME_UICOMPMESSAGE) + dwBufLen + sizeof(WCHAR); 00414 // 00415 // Display character to Console 00416 // 00417 CopyData.dwData = CI_CONIMEMODEINFO; 00418 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00419 CopyData.lpData = lpModeInfo; 00420 00421 if (MakeInfoStringTaiwan(ConTbl, lpModeInfo) ) { 00422 ConsoleImeSendMessage( ConTbl->hWndCon, 00423 (WPARAM)hwnd, 00424 (LPARAM)&CopyData 00425 ); 00426 } 00427 } 00428 else if (CompFlag & GCS_RESULTSTR) 00429 { 00430 // 00431 // Reads in the result string. 00432 // 00433 ImmGetCompositionString( hIMC, GCS_RESULTSTR, TempBuf, dwBufLen ); 00434 00435 // 00436 // Null terminated. 00437 // 00438 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00439 00440 lpCompStrMem->dwResultStrLen = dwBufLen; 00441 if (lpCompStrMem->dwResultStrLen) 00442 lpCompStrMem->dwResultStrOffset = sizeof(CONIME_UICOMPMESSAGE); 00443 // 00444 // send character to Console 00445 // 00446 CopyData.dwData = CI_CONIMECOMPOSITION; 00447 CopyData.cbData = lpCompStrMem->dwSize; 00448 CopyData.lpData = lpCompStrMem; 00449 ConsoleImeSendMessage( ConTbl->hWndCon, 00450 (WPARAM)hwnd, 00451 (LPARAM)&CopyData 00452 ); 00453 00454 } 00455 else if (CompFlag == 0) 00456 { 00457 TempBuf[ dwBufLen / sizeof(WCHAR) ] = TEXT('\0'); 00458 TempBufA[ dwBufLenAttr ] = (BYTE)0; 00459 lpCompStrMem->dwResultStrLen = dwBufLen; 00460 lpCompStrMem->dwCompStrLen = dwBufLen; 00461 lpCompStrMem->dwCompAttrLen = dwBufLenAttr; 00462 // 00463 // Display character to Console 00464 // 00465 CopyData.dwData = CI_CONIMEMODEINFO; 00466 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00467 CopyData.lpData = lpModeInfo; 00468 00469 if (MakeInfoStringTaiwan(ConTbl, lpModeInfo) ) { 00470 ConsoleImeSendMessage( ConTbl->hWndCon, 00471 (WPARAM)hwnd, 00472 (LPARAM)&CopyData 00473 ); 00474 } 00475 } 00476 00477 00478 LocalFree( lpModeInfo ); 00479 00480 ImmReleaseContext( hwnd, hIMC ); 00481 return; 00482 00483 }

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 }

DWORD GetNLSMode HWND  hWnd,
HANDLE  hConsole
 

Definition at line 640 of file consubs.c.

References DBGPRINT, _CONSOLE_TABLE::dwConversion, _CONSOLE_TABLE::dwSentence, _CONSOLE_TABLE::fOpen, GetOpenStatusByCodepage(), hWnd, IME_CMODE_DISABLE, IME_CMODE_OPEN, ImmGetContext(), ImmGetConversionStatus(), ImmReleaseContext(), NULL, and SearchConsole().

Referenced by WndProc().

00644 { 00645 PCONSOLE_TABLE ConTbl; 00646 HIMC hIMC; 00647 00648 ConTbl = SearchConsole(hConsole); 00649 if (ConTbl == NULL) { 00650 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00651 return 0; 00652 } 00653 00654 hIMC = ImmGetContext( hWnd ) ; 00655 if ( hIMC == (HIMC)NULL ) 00656 return IME_CMODE_DISABLE; 00657 00658 ImmGetConversionStatus(hIMC, 00659 &ConTbl->dwConversion, 00660 &ConTbl->dwSentence); 00661 ConTbl->fOpen = GetOpenStatusByCodepage( hIMC, ConTbl ) ; 00662 00663 ImmReleaseContext( hWnd, hIMC ); 00664 00665 00666 return ((ConTbl->fOpen ? IME_CMODE_OPEN : 0) + ConTbl->dwConversion); 00667 }

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 }

DWORD GetSystemLineJ LPCANDIDATELIST  lpCandList,
LPWSTR  String,
LPSTR  Attr,
DWORD  dwLength,
DWORD  CountDispWidth,
PCONSOLE_TABLE  FocusedConsole,
BOOL  EnableCodePoint
 

Definition at line 805 of file country2.c.

References BOOL, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandSep, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, HIBYTE, _CONSOLE_TABLE::ImmGetProperty, IsUnicodeFullWidth(), LOBYTE, NULL, NumString(), PBYTE, String, TRUE, UNICODE_COLON, UNICODE_HEXBASE, UNICODE_LEFT, UNICODE_RIGHT, UNICODE_SLASH, UNICODE_SPACE, UNICODE_ZERO, and USHORT.

Referenced by OpenCandidateJapan(), and OpenCandidateKorea().

00813 { 00814 DWORD dwStrLen; 00815 DWORD dwDspLen; 00816 DWORD i; 00817 DWORD j; 00818 DWORD SepIndex; 00819 DWORD SelCount; 00820 DWORD Length; 00821 DWORD dwWholeLen; 00822 BOOL lfBreak = FALSE; 00823 LPWSTR StrToWrite; 00824 LPSTR AttrToSel; 00825 LPWSTR lpStr; 00826 USHORT MultiChar; 00827 USHORT TempMulti; 00828 00829 if ((lpCandList->dwSelection > lpCandList->dwCount)|| 00830 (lpCandList->dwSelection < 0)) { 00831 lpCandList->dwSelection = 0; 00832 } 00833 00834 for ( SepIndex = FocusedConsole->CandMax; SepIndex > 0; SepIndex--) { 00835 if (lpCandList->dwSelection >= FocusedConsole->CandSep[SepIndex]) 00836 break; 00837 } 00838 if (SepIndex == FocusedConsole->CandMax) 00839 SepIndex = 0; 00840 00841 for ( i = 0; i < dwLength; i++) { 00842 Attr[i] = 0x0000; 00843 } 00844 StrToWrite = String; 00845 AttrToSel = Attr; 00846 dwWholeLen = 0; 00847 #if 1 00848 // HACK HACK ntbug #69699 00849 // MS-IME97 & MS-IME97A does not return correct value for IME_PROP_CANDLIST_START_FROM_1. 00850 // These always return its starting from 0. 00851 // Currently there is not IME starting from 0. So we hack. 00852 // Actually IME should be fixed. 00853 SelCount = 1; 00854 #else 00855 if (FocusedConsole->ImmGetProperty & IME_PROP_CANDLIST_START_FROM_1) 00856 SelCount = 1; 00857 else 00858 SelCount = 0; 00859 #endif 00860 00861 if (EnableCodePoint){ 00862 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[lpCandList->dwSelection]); 00863 WideCharToMultiByte(CP_OEMCP, 0, lpStr, 1, (PBYTE)&TempMulti, 2, NULL, NULL); 00864 *StrToWrite = UNICODE_LEFT; 00865 StrToWrite++; 00866 MultiChar = (USHORT)(HIBYTE(TempMulti)| LOBYTE(TempMulti)<<8); 00867 for (i = 0; i < 4; i++) { 00868 j = (MultiChar & 0xf000 ) >> 12; 00869 if ( j <= 9) 00870 *StrToWrite = (USHORT)(j + UNICODE_ZERO); 00871 else 00872 *StrToWrite = (USHORT)(j + UNICODE_HEXBASE); 00873 StrToWrite++; 00874 MultiChar = (USHORT)(MultiChar << 4); 00875 } 00876 *StrToWrite = UNICODE_RIGHT; 00877 StrToWrite++; 00878 *StrToWrite = UNICODE_SPACE; 00879 StrToWrite++; 00880 AttrToSel += CountDispWidth; 00881 dwWholeLen += CountDispWidth; 00882 CountDispWidth = 0; 00883 } 00884 00885 for (i = FocusedConsole->CandSep[SepIndex]; i < FocusedConsole->CandSep[SepIndex+1]; i++) { 00886 // 00887 // check each offset value is not over than buffer size. 00888 // 00889 if (lpCandList->dwOffset[i] >= lpCandList->dwSize) 00890 break; 00891 00892 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 00893 dwStrLen = lstrlenW( lpStr ); 00894 dwDspLen = DispLenUnicode( lpStr ); 00895 00896 if ( dwWholeLen + dwDspLen + DELIMITERWIDTH > dwLength - CountDispWidth ){ 00897 Length = 0; 00898 lfBreak = TRUE; 00899 for (j = 0; j < dwStrLen; j++ ){ 00900 Length += IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 00901 if (dwWholeLen + Length > dwLength - (CountDispWidth + DELIMITERWIDTH)){ 00902 dwStrLen = j-1; 00903 dwDspLen = Length - IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 00904 break; 00905 } 00906 } 00907 } 00908 if ((dwWholeLen + dwDspLen + DELIMITERWIDTH + CountDispWidth ) <= dwLength ) // if minus value 00909 dwWholeLen += (dwDspLen + DELIMITERWIDTH); 00910 else { 00911 break; 00912 } 00913 00914 if (i == lpCandList->dwSelection) { 00915 for (j = 0; j < dwStrLen+2; j++) 00916 *(AttrToSel+j) = 1; 00917 } 00918 *StrToWrite = (USHORT)(SelCount + UNICODE_ZERO); 00919 StrToWrite++; 00920 *StrToWrite = UNICODE_COLON; 00921 StrToWrite++; 00922 CopyMemory(StrToWrite, lpStr, dwStrLen * sizeof(WCHAR)); 00923 StrToWrite += dwStrLen; 00924 *StrToWrite = UNICODE_SPACE; 00925 StrToWrite++; 00926 AttrToSel += dwStrLen+DELIMITERWIDTH; 00927 SelCount++; 00928 if (lfBreak) 00929 break; 00930 } 00931 *StrToWrite = 0; 00932 dwDspLen = DispLenUnicode( String ); 00933 if (dwDspLen > (dwLength - CountDispWidth)) 00934 return SepIndex; 00935 00936 if (EnableCodePoint){ 00937 for (i = dwDspLen; i < dwLength; i++) { 00938 *StrToWrite = UNICODE_SPACE; 00939 StrToWrite++; 00940 } 00941 } 00942 else { 00943 for (i = dwDspLen; i < (dwLength - CountDispWidth); i++) { 00944 *StrToWrite = UNICODE_SPACE; 00945 StrToWrite++; 00946 } 00947 00948 i = (CountDispWidth-1) / 2; 00949 NumString(StrToWrite,lpCandList->dwSelection+1,i); 00950 StrToWrite+=i; 00951 *StrToWrite = UNICODE_SLASH; 00952 StrToWrite++; 00953 NumString(StrToWrite,lpCandList->dwCount, i); 00954 StrToWrite+=i; 00955 } 00956 *StrToWrite = 0; 00957 00958 return SepIndex; 00959 }

DWORD GetSystemLineP LPCANDIDATELIST  lpCandList,
LPWSTR  String,
LPSTR  Attr,
DWORD  dwLength,
DWORD  CountDispWidth,
PCONSOLE_TABLE  FocusedConsole
 

Definition at line 1071 of file country2.c.

References BOOL, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandSep, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::ImmGetProperty, IsUnicodeFullWidth(), NumString(), String, TRUE, UNICODE_COLON, UNICODE_SLASH, UNICODE_SPACE, UNICODE_ZERO, and USHORT.

Referenced by OpenCandidatePRC().

01079 { 01080 DWORD dwStrLen; 01081 DWORD dwDspLen; 01082 DWORD i; 01083 DWORD j; 01084 DWORD SepIndex; 01085 DWORD SelCount; 01086 DWORD Length; 01087 DWORD dwWholeLen; 01088 BOOL lfBreak = FALSE; 01089 LPWSTR StrToWrite; 01090 LPSTR AttrToSel; 01091 LPWSTR lpStr; 01092 USHORT MultiChar; 01093 USHORT TempMulti; 01094 01095 if ((lpCandList->dwSelection > lpCandList->dwCount)|| 01096 (lpCandList->dwSelection < 0)) { 01097 lpCandList->dwSelection = 0; 01098 } 01099 01100 for ( SepIndex = FocusedConsole->CandMax; SepIndex > 0; SepIndex--) { 01101 if (lpCandList->dwSelection >= FocusedConsole->CandSep[SepIndex]) 01102 break; 01103 } 01104 if (SepIndex == FocusedConsole->CandMax) 01105 SepIndex = 0; 01106 01107 for ( i = 0; i < dwLength; i++) { 01108 Attr[i] = 0x0000; 01109 } 01110 StrToWrite = String; 01111 AttrToSel = Attr; 01112 dwWholeLen = 0; 01113 if (FocusedConsole->ImmGetProperty & IME_PROP_CANDLIST_START_FROM_1) 01114 SelCount = 1; 01115 else 01116 SelCount = 0; 01117 01118 for (i = FocusedConsole->CandSep[SepIndex]; i < FocusedConsole->CandSep[SepIndex+1]; i++) { 01119 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 01120 dwStrLen = lstrlenW( lpStr ); 01121 dwDspLen = DispLenUnicode( lpStr ); 01122 01123 if ( dwWholeLen + dwDspLen + DELIMITERWIDTH > dwLength - CountDispWidth ){ 01124 Length = 0; 01125 lfBreak = TRUE; 01126 for (j = 0; j < dwStrLen; j++ ){ 01127 Length += IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 01128 if (dwWholeLen + Length > dwLength - (CountDispWidth + DELIMITERWIDTH)){ 01129 dwStrLen = j-1; 01130 dwDspLen = Length - IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 01131 break; 01132 } 01133 } 01134 } 01135 if ((dwWholeLen + dwDspLen + DELIMITERWIDTH + CountDispWidth ) <= dwLength ) // if minus value 01136 dwWholeLen += (dwDspLen + DELIMITERWIDTH); 01137 else { 01138 break; 01139 } 01140 01141 if (i == lpCandList->dwSelection) { 01142 for (j = 0; j < dwStrLen+2; j++) 01143 *(AttrToSel+j) = 1; 01144 } 01145 *StrToWrite = (USHORT)(SelCount + UNICODE_ZERO); 01146 StrToWrite++; 01147 *StrToWrite = UNICODE_COLON; 01148 StrToWrite++; 01149 CopyMemory(StrToWrite, lpStr, dwStrLen * sizeof(WCHAR)); 01150 StrToWrite += dwStrLen; 01151 *StrToWrite = UNICODE_SPACE; 01152 StrToWrite++; 01153 AttrToSel += dwStrLen+DELIMITERWIDTH; 01154 SelCount++; 01155 if (lfBreak) 01156 break; 01157 } 01158 *StrToWrite = 0; 01159 dwDspLen = DispLenUnicode( String ); 01160 if (dwDspLen > (dwLength - CountDispWidth)) 01161 return SepIndex; 01162 01163 #if defined (CANDCOUNTPRC) //for wider candidate list space v-hirshi Oct.16.1996 01164 *StrToWrite = UNICODE_SPACE; 01165 StrToWrite++; 01166 01167 i = (CountDispWidth-1) / 2; 01168 NumString(StrToWrite,lpCandList->dwSelection+1,i); 01169 StrToWrite+=i; 01170 *StrToWrite = UNICODE_SLASH; 01171 StrToWrite++; 01172 NumString(StrToWrite,lpCandList->dwCount, i); 01173 StrToWrite+=i; 01174 #endif 01175 01176 *StrToWrite = 0; 01177 01178 return SepIndex; 01179 }

DWORD GetSystemLineT LPCANDIDATELIST  lpCandList,
LPWSTR  String,
LPSTR  Attr,
DWORD  dwLength,
DWORD  CountDispWidth,
PCONSOLE_TABLE  FocusedConsole
 

Definition at line 962 of file country2.c.

References BOOL, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandSep, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::ImmGetProperty, IsUnicodeFullWidth(), NumString(), String, TRUE, UNICODE_COLON, UNICODE_SLASH, UNICODE_SPACE, UNICODE_ZERO, and USHORT.

Referenced by OpenCandidateTaiwan().

00970 { 00971 DWORD dwStrLen; 00972 DWORD dwDspLen; 00973 DWORD i; 00974 DWORD j; 00975 DWORD SepIndex; 00976 DWORD SelCount; 00977 DWORD Length; 00978 DWORD dwWholeLen; 00979 BOOL lfBreak = FALSE; 00980 LPWSTR StrToWrite; 00981 LPSTR AttrToSel; 00982 LPWSTR lpStr; 00983 USHORT MultiChar; 00984 USHORT TempMulti; 00985 00986 if ((lpCandList->dwSelection > lpCandList->dwCount)|| 00987 (lpCandList->dwSelection < 0)) { 00988 lpCandList->dwSelection = 0; 00989 } 00990 00991 for ( SepIndex = FocusedConsole->CandMax; SepIndex > 0; SepIndex--) { 00992 if (lpCandList->dwSelection >= FocusedConsole->CandSep[SepIndex]) 00993 break; 00994 } 00995 if (SepIndex == FocusedConsole->CandMax) 00996 SepIndex = 0; 00997 00998 for ( i = 0; i < dwLength; i++) { 00999 Attr[i] = 0x0000; 01000 } 01001 StrToWrite = String; 01002 AttrToSel = Attr; 01003 dwWholeLen = 0; 01004 if (FocusedConsole->ImmGetProperty & IME_PROP_CANDLIST_START_FROM_1) 01005 SelCount = 1; 01006 else 01007 SelCount = 0; 01008 01009 01010 for (i = FocusedConsole->CandSep[SepIndex]; i < FocusedConsole->CandSep[SepIndex+1]; i++) { 01011 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 01012 dwStrLen = lstrlenW( lpStr ); 01013 dwDspLen = DispLenUnicode( lpStr ); 01014 01015 if ( dwWholeLen + dwDspLen + DELIMITERWIDTH > dwLength - CountDispWidth ){ 01016 Length = 0; 01017 lfBreak = TRUE; 01018 for (j = 0; j < dwStrLen; j++ ){ 01019 Length += IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 01020 if (dwWholeLen + Length > dwLength - (CountDispWidth + DELIMITERWIDTH)){ 01021 dwStrLen = j-1; 01022 dwDspLen = Length - IsUnicodeFullWidth(lpStr[j]) ? 2 : 1; 01023 break; 01024 } 01025 } 01026 } 01027 if ((dwWholeLen + dwDspLen + DELIMITERWIDTH + CountDispWidth ) <= dwLength ) // if minus value 01028 dwWholeLen += (dwDspLen + DELIMITERWIDTH); 01029 else { 01030 break; 01031 } 01032 01033 if (i == lpCandList->dwSelection) { 01034 for (j = 0; j < dwStrLen+2; j++) 01035 *(AttrToSel+j) = 1; 01036 } 01037 *StrToWrite = (USHORT)(SelCount + UNICODE_ZERO); 01038 StrToWrite++; 01039 *StrToWrite = UNICODE_COLON; 01040 StrToWrite++; 01041 CopyMemory(StrToWrite, lpStr, dwStrLen * sizeof(WCHAR)); 01042 StrToWrite += dwStrLen; 01043 *StrToWrite = UNICODE_SPACE; 01044 StrToWrite++; 01045 AttrToSel += dwStrLen+DELIMITERWIDTH; 01046 SelCount++; 01047 if (lfBreak) 01048 break; 01049 } 01050 *StrToWrite = 0; 01051 dwDspLen = DispLenUnicode( String ); 01052 if (dwDspLen > (dwLength - CountDispWidth)) 01053 return SepIndex; 01054 01055 *StrToWrite = UNICODE_SPACE; 01056 StrToWrite++; 01057 01058 i = (CountDispWidth-1) / 2; 01059 NumString(StrToWrite,lpCandList->dwSelection+1,i); 01060 StrToWrite+=i; 01061 *StrToWrite = UNICODE_SLASH; 01062 StrToWrite++; 01063 NumString(StrToWrite,lpCandList->dwCount, i); 01064 StrToWrite+=i; 01065 *StrToWrite = 0; 01066 01067 return SepIndex; 01068 }

BOOL GrowConsoleTable VOID   ) 
 

Definition at line 742 of file ntcon/conime/conime.c.

References CONSOLE_CONSOLE_TABLE_INCREMENT, ConsoleTable, FALSE, NULL, NumberOfConsoleTable, PCONSOLE_TABLE, and TRUE.

Referenced by InsertConsole().

00745 { 00746 PCONSOLE_TABLE *NewTable; 00747 PCONSOLE_TABLE *OldTable; 00748 ULONG MaxConsoleTable; 00749 00750 MaxConsoleTable = NumberOfConsoleTable + CONSOLE_CONSOLE_TABLE_INCREMENT; 00751 NewTable = (PCONSOLE_TABLE *)LocalAlloc(LPTR, MaxConsoleTable * sizeof(PCONSOLE_TABLE)); 00752 if (NewTable == NULL) { 00753 return FALSE; 00754 } 00755 CopyMemory(NewTable, ConsoleTable, NumberOfConsoleTable * sizeof(PCONSOLE_TABLE)); 00756 00757 OldTable = ConsoleTable; 00758 ConsoleTable = NewTable; 00759 NumberOfConsoleTable = MaxConsoleTable; 00760 00761 LocalFree(OldTable); 00762 00763 return TRUE; 00764 }

VOID ImeOpenClose HWND  hWnd,
BOOL  fFlag
 

Definition at line 30 of file imefull.c.

References hWnd, ImmGetContext(), ImmReleaseContext(), ImmSetOpenStatus(), and VOID().

00031 { 00032 HIMC hIMC; 00033 00034 // 00035 // If fFlag is true then open IME; otherwise close it. 00036 // 00037 00038 if ( !( hIMC = ImmGetContext( hWnd ) ) ) 00039 return; 00040 00041 ImmSetOpenStatus( hIMC, fFlag ); 00042 00043 ImmReleaseContext( hWnd, hIMC ); 00044 00045 }

BOOL ImeSysPropertyWindow HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 747 of file consubs.c.

References CI_CONIMEPROPERTYINFO, ConsoleImeSendMessage(), DBGPRINT, FALSE, hWnd, _CONSOLE_TABLE::hWndCon, LastConsole, NULL, SearchConsole(), and TRUE.

Referenced by WndProc().

00752 { 00753 PCONSOLE_TABLE ConTbl; 00754 COPYDATASTRUCT CopyData; 00755 00756 ConTbl = SearchConsole(LastConsole); 00757 if (ConTbl == NULL) { 00758 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00759 return FALSE; 00760 } 00761 00762 CopyData.dwData = CI_CONIMEPROPERTYINFO; 00763 CopyData.cbData = sizeof(WPARAM); 00764 CopyData.lpData = &wParam; 00765 00766 ConsoleImeSendMessage( ConTbl->hWndCon, 00767 (WPARAM)hWnd, 00768 (LPARAM)&CopyData 00769 ); 00770 00771 return TRUE; 00772 }

BOOL ImeUIChangeCandidate HWND  hwnd,
DWORD  lParam
 

Definition at line 458 of file consubs.c.

References FALSE, and ImeUIOpenCandidate().

Referenced by ImeUINotify().

00462 { 00463 return ImeUIOpenCandidate( hwnd, lParam, FALSE) ; 00464 }

BOOL ImeUICloseCandidate HWND  hwnd,
DWORD  lParam
 

Definition at line 1204 of file country2.c.

References CloseCandidateJapan(), CloseCandidateKorea(), CloseCandidatePRC(), CloseCandidateTaiwan(), DBGPRINT, FALSE, _CONSOLE_TABLE::fInCandidate, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, ImmGetContext(), ImmReleaseContext(), LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, LANG_ID_TAIWAN, LastConsole, NULL, SearchConsole(), and TRUE.

Referenced by ImeUINotify().

01208 { 01209 HIMC hIMC; 01210 PCONSOLE_TABLE ConTbl; 01211 01212 DBGPRINT(("CONIME: Get IMN_CLOSECANDIDATE Message\n")); 01213 01214 ConTbl = SearchConsole(LastConsole); 01215 if (ConTbl == NULL) { 01216 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 01217 return FALSE; 01218 } 01219 01220 hIMC = ImmGetContext( hwnd ); 01221 if ( hIMC == 0 ) 01222 return FALSE; 01223 01224 // 01225 // Reset fInCandidate variables. 01226 // 01227 ConTbl->fInCandidate = FALSE; 01228 01229 switch ( HKL_TO_LANGID(ConTbl->hklActive)) 01230 { 01231 case LANG_ID_JAPAN: 01232 CloseCandidateJapan(hwnd, hIMC, ConTbl, CandList ); 01233 break; 01234 case LANG_ID_TAIWAN: 01235 CloseCandidateTaiwan(hwnd, hIMC, ConTbl, CandList ); 01236 break; 01237 case LANG_ID_PRC: 01238 CloseCandidatePRC(hwnd, hIMC, ConTbl, CandList ); 01239 break; 01240 case LANG_ID_KOREA: 01241 CloseCandidateKorea(hwnd, hIMC, ConTbl, CandList ); 01242 break; 01243 default: 01244 return FALSE; 01245 break; 01246 } 01247 ImmReleaseContext( hwnd, hIMC ); 01248 01249 return TRUE; 01250 }

void ImeUIComposition HWND  hwnd,
WPARAM  wParam,
LPARAM  CompFlag
 

Definition at line 160 of file consubs.c.

References DBGPRINT, FIRSTCOL, GetCompositionStr(), MAXCOL, and UNICODE_SPACE.

Referenced by WndProc().

00161 { 00162 00163 DBGPRINT(("CONIME: WM_IME_COMPOSITION %08x %08x\n",CompChar,CompFlag)); 00164 00165 #ifdef DEBUG_MODE 00166 { 00167 int i ; 00168 for (i = FIRSTCOL ; i < MAXCOL ; i++) { 00169 ConvertLine[i] = UNICODE_SPACE ; 00170 ConvertLineAtr[i] = 0 ; 00171 } 00172 xPos = FIRSTCOL; 00173 xPosLast = FIRSTCOL; 00174 } 00175 #endif 00176 00177 if ( CompFlag == 0 ) { 00178 DBGPRINT((" None\n")); 00179 GetCompositionStr( hwnd, CompFlag, CompChar); 00180 } 00181 if ( CompFlag & GCS_RESULTSTR ) { 00182 DBGPRINT((" GCS_RESULTSTR\n")); 00183 GetCompositionStr( hwnd, ( CompFlag & GCS_RESULTSTR ), CompChar ); 00184 } 00185 if ( CompFlag & GCS_COMPSTR ) { 00186 DBGPRINT((" GCS_COMPSTR\n")); 00187 GetCompositionStr( hwnd, ( CompFlag & (GCS_COMPSTR|GCS_COMPATTR)), CompChar); 00188 } 00189 if ( CompFlag & CS_INSERTCHAR ) { 00190 DBGPRINT((" CS_INSERTCHAR\n")); 00191 GetCompositionStr( hwnd, ( CompFlag & (CS_INSERTCHAR|GCS_COMPATTR)), CompChar); 00192 } 00193 if ( CompFlag & CS_NOMOVECARET ) { 00194 DBGPRINT((" CS_NOMOVECARET\n")); 00195 GetCompositionStr( hwnd, ( CompFlag & (CS_NOMOVECARET|GCS_COMPATTR)), CompChar); 00196 } 00197 }

void ImeUIEndComposition HWND  hwnd  ) 
 

Definition at line 108 of file consubs.c.

References DBGPRINT, FALSE, _CONSOLE_TABLE::fInComposition, FIRSTCOL, LastConsole, _CONSOLE_TABLE::lpCompStrMem, MAXCOL, NULL, SearchConsole(), and UNICODE_SPACE.

Referenced by WndProc().

00109 { 00110 PCONSOLE_TABLE ConTbl; 00111 00112 ConTbl = SearchConsole(LastConsole); 00113 if (ConTbl == NULL) { 00114 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00115 return; 00116 } 00117 00118 // 00119 // Reset fInComposition variables. 00120 // 00121 ConTbl->fInComposition = FALSE; 00122 00123 if (ConTbl->lpCompStrMem) 00124 LocalFree( ConTbl->lpCompStrMem ); 00125 ConTbl->lpCompStrMem = NULL ; 00126 00127 #ifdef DEBUG_MODE 00128 { 00129 int i ; 00130 // 00131 // Reset the length of composition string to zero. 00132 // 00133 for (i = FIRSTCOL ; i < MAXCOL ; i++) { 00134 ConvertLine[i] = UNICODE_SPACE ; 00135 ConvertLineAtr[i] = 0 ; 00136 } 00137 } 00138 #endif 00139 #ifdef DEBUG_INFO 00140 xPos = FIRSTCOL; 00141 xPosLast = FIRSTCOL; 00142 HideCaret( hwnd ); 00143 DisplayConvInformation( hwnd ) ; 00144 ResetCaret( hwnd ); 00145 #endif 00146 }

BOOL ImeUIGuideLine HWND  hwnd  ) 
 

Definition at line 576 of file consubs.c.

References CI_CONIMESYSINFO, ConsoleImeSendMessage(), DBGPRINT, DWORD, FALSE, _CONSOLE_TABLE::hWndCon, ImmGetContext(), ImmReleaseContext(), Index, LastConsole, NULL, SearchConsole(), _CONIME_UIMESSAGE::String, and TRUE.

Referenced by ImeUINotify().

00579 { 00580 PCONSOLE_TABLE ConTbl; 00581 HIMC hIMC ; // Input context handle. 00582 DWORD Level ; 00583 DWORD Index ; 00584 DWORD Length ; 00585 LPCONIME_UIMESSAGE GuideLine ; 00586 COPYDATASTRUCT CopyData ; 00587 00588 DBGPRINT(("CONIME: Get IMN_GUIDELINE Message ")); 00589 00590 ConTbl = SearchConsole(LastConsole); 00591 if (ConTbl == NULL) { 00592 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00593 return FALSE; 00594 } 00595 00596 hIMC = ImmGetContext( hwnd ) ; 00597 if ( hIMC == 0 ) 00598 return FALSE; 00599 00600 Level = ImmGetGuideLine(hIMC, GGL_LEVEL, NULL, 0) ; 00601 Index = ImmGetGuideLine(hIMC, GGL_INDEX, NULL, 0) ; 00602 Length = ImmGetGuideLine(hIMC, GGL_STRING, NULL, 0) ; 00603 DBGPRINT(("Level=%d Index=%d Length=%d",Level,Index,Length)); 00604 if (Length == 0) { 00605 CopyData.dwData = CI_CONIMESYSINFO ; 00606 CopyData.cbData = Length ; 00607 CopyData.lpData = NULL ; 00608 00609 ConsoleImeSendMessage( ConTbl->hWndCon, 00610 (WPARAM)hwnd, 00611 (LPARAM)&CopyData 00612 ) ; 00613 } 00614 else{ 00615 GuideLine = (LPCONIME_UIMESSAGE)LocalAlloc(LPTR, Length + sizeof(WCHAR)) ; 00616 if (GuideLine == NULL) { 00617 ImmReleaseContext( hwnd, hIMC ); 00618 return FALSE; 00619 } 00620 00621 CopyData.dwData = CI_CONIMESYSINFO ; 00622 CopyData.cbData = Length + sizeof(WCHAR) ; 00623 CopyData.lpData = GuideLine ; 00624 Length = ImmGetGuideLine(hIMC, GGL_STRING, GuideLine->String, Length) ; 00625 00626 ConsoleImeSendMessage( ConTbl->hWndCon, 00627 (WPARAM)hwnd, 00628 (LPARAM)&CopyData 00629 ) ; 00630 00631 LocalFree( GuideLine ) ; 00632 } 00633 ImmReleaseContext( hwnd, hIMC ); 00634 DBGPRINT(("\n")); 00635 00636 return TRUE ; 00637 }

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 }

BOOL ImeUINotify HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 261 of file consubs.c.

References BOOL, DWORD, FALSE, ImeUIChangeCandidate(), ImeUICloseCandidate(), ImeUIGuideLine(), ImeUIOpenCandidate(), ImeUIOpenStatusWindow(), ImeUISetConversionMode(), ImeUISetOpenStatus(), and TRUE.

Referenced by WndProc().

00262 { 00263 switch (wParam ) 00264 { 00265 case IMN_OPENSTATUSWINDOW: 00266 ImeUIOpenStatusWindow(hwnd) ; 00267 break; 00268 case IMN_CHANGECANDIDATE: 00269 ImeUIChangeCandidate( hwnd, (DWORD)lParam ); 00270 break; 00271 case IMN_CLOSECANDIDATE: 00272 ImeUICloseCandidate( hwnd, (DWORD)lParam ); 00273 break; 00274 case IMN_OPENCANDIDATE: 00275 ImeUIOpenCandidate( hwnd, (DWORD)lParam, TRUE); 00276 break; 00277 case IMN_SETCONVERSIONMODE: 00278 ImeUISetConversionMode(hwnd) ; 00279 // IMN_SETCONVERSIONMODE should be pass to DefWindowProc 00280 // becuase ImeNotifyHandler in User32 does notify to shell and keyboard. 00281 return FALSE; 00282 case IMN_SETOPENSTATUS: 00283 ImeUISetOpenStatus( hwnd ); 00284 // IMN_SETOPENSTATUS should be pass to DefWindowProc 00285 // becuase ImeNotifyHandler in User32 does notify to shell and keyboard. 00286 return FALSE; 00287 case IMN_GUIDELINE: 00288 ImeUIGuideLine(hwnd) ; 00289 break; 00290 default: 00291 return FALSE; 00292 00293 } 00294 return TRUE; 00295 }

BOOL ImeUIOpenCandidate HWND  hwnd,
DWORD  lParam,
BOOL  OpenFlag
 

Definition at line 24 of file country2.c.

References DBGPRINT, FALSE, _CONSOLE_TABLE::fInCandidate, _CONSOLE_TABLE::fNestCandidate, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, ImmGetContext(), ImmReleaseContext(), LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, LANG_ID_TAIWAN, LastConsole, NULL, OpenCandidateJapan(), OpenCandidateKorea(), OpenCandidatePRC(), OpenCandidateTaiwan(), SearchConsole(), and TRUE.

Referenced by ImeUIChangeCandidate(), and ImeUINotify().

00029 { 00030 PCONSOLE_TABLE ConTbl; 00031 HIMC hIMC; 00032 00033 DBGPRINT(("CONIME: Get IMN_OPENCANDIDATE Message\n")); 00034 00035 00036 ConTbl = SearchConsole(LastConsole); 00037 00038 if (ConTbl->fNestCandidate) 00039 return TRUE; 00040 00041 if (ConTbl == NULL) { 00042 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00043 return FALSE; 00044 } 00045 00046 hIMC = ImmGetContext( hwnd ); 00047 if ( hIMC == 0 ) 00048 return FALSE; 00049 00050 // 00051 // Set fInCandidate variables. 00052 // 00053 ConTbl->fInCandidate = TRUE; 00054 00055 switch ( HKL_TO_LANGID(ConTbl->hklActive)) 00056 { 00057 case LANG_ID_JAPAN: 00058 OpenCandidateJapan(hwnd, hIMC, ConTbl, CandList, OpenFlag ); 00059 break; 00060 case LANG_ID_TAIWAN: 00061 OpenCandidateTaiwan(hwnd, hIMC, ConTbl, CandList, OpenFlag ); 00062 break; 00063 case LANG_ID_PRC: 00064 OpenCandidatePRC(hwnd, hIMC, ConTbl, CandList, OpenFlag ); 00065 break; 00066 case LANG_ID_KOREA: 00067 OpenCandidateKorea(hwnd, hIMC, ConTbl, CandList, OpenFlag ); 00068 break; 00069 default: 00070 return FALSE; 00071 } 00072 00073 ImmReleaseContext( hwnd, hIMC ); 00074 00075 return TRUE; 00076 }

BOOL ImeUIOpenStatusWindow HWND  hwnd  ) 
 

Definition at line 406 of file consubs.c.

References CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONSOLE_TABLE::dwConversion, _CONSOLE_TABLE::dwSentence, FALSE, _CONSOLE_TABLE::hWndCon, ImeUIMakeInfoString(), ImmGetContext(), ImmGetConversionStatus(), ImmReleaseContext(), LastConsole, NULL, SearchConsole(), and TRUE.

Referenced by ConImeInputLangchange(), ImeUINotify(), and InputLangchange().

00409 { 00410 PCONSOLE_TABLE ConTbl; 00411 HIMC hIMC; // Input context handle. 00412 LPCONIME_UIMODEINFO lpModeInfo ; 00413 COPYDATASTRUCT CopyData ; 00414 00415 DBGPRINT(("CONIME: Get IMN_OPENSTATUSWINDOW Message\n")); 00416 00417 ConTbl = SearchConsole(LastConsole); 00418 if (ConTbl == NULL) { 00419 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00420 return FALSE; 00421 } 00422 00423 hIMC = ImmGetContext( hwnd ) ; 00424 if ( hIMC == 0 ) 00425 return FALSE; 00426 00427 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ) ; 00428 if ( lpModeInfo == NULL) { 00429 ImmReleaseContext( hwnd, hIMC ); 00430 return FALSE; 00431 } 00432 00433 ImmGetConversionStatus(hIMC, 00434 (LPDWORD)&ConTbl->dwConversion, 00435 (LPDWORD)&ConTbl->dwSentence) ; 00436 00437 CopyData.dwData = CI_CONIMEMODEINFO ; 00438 CopyData.cbData = sizeof(CONIME_UIMODEINFO) ; 00439 CopyData.lpData = lpModeInfo ; 00440 if (ImeUIMakeInfoString(ConTbl, 00441 lpModeInfo)) 00442 { 00443 ConsoleImeSendMessage( ConTbl->hWndCon, 00444 (WPARAM)hwnd, 00445 (LPARAM)&CopyData 00446 ) ; 00447 } 00448 00449 LocalFree( lpModeInfo ); 00450 00451 ImmReleaseContext( hwnd, hIMC ); 00452 00453 return TRUE ; 00454 }

BOOL ImeUISetConversionMode HWND  hwnd  ) 
 

Definition at line 522 of file consubs.c.

References CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONSOLE_TABLE::dwConversion, DWORD, _CONSOLE_TABLE::dwSentence, FALSE, _CONSOLE_TABLE::hWndCon, ImeUIMakeInfoString(), ImmGetContext(), ImmGetConversionStatus(), ImmReleaseContext(), LastConsole, NULL, SearchConsole(), and TRUE.

Referenced by ImeUINotify(), and WndProc().

00525 { 00526 PCONSOLE_TABLE ConTbl; 00527 HIMC hIMC; // Input context handle. 00528 LPCONIME_UIMODEINFO lpModeInfo ; 00529 COPYDATASTRUCT CopyData ; 00530 DWORD OldConversion ; 00531 00532 00533 DBGPRINT(("CONIME: Get IMN_SETCONVERSIONMODE Message\n")); 00534 00535 ConTbl = SearchConsole(LastConsole); 00536 if (ConTbl == NULL) { 00537 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00538 return FALSE; 00539 } 00540 00541 hIMC = ImmGetContext( hwnd ) ; 00542 if ( hIMC == 0 ) 00543 return FALSE; 00544 00545 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ) ; 00546 if ( lpModeInfo == NULL) { 00547 ImmReleaseContext( hwnd, hIMC ); 00548 return FALSE; 00549 } 00550 00551 OldConversion = ConTbl->dwConversion ; 00552 00553 ImmGetConversionStatus(hIMC, 00554 (LPDWORD)&ConTbl->dwConversion, 00555 (LPDWORD)&ConTbl->dwSentence) ; 00556 00557 CopyData.dwData = CI_CONIMEMODEINFO ; 00558 CopyData.cbData = sizeof(CONIME_UIMODEINFO) ; 00559 CopyData.lpData = lpModeInfo ; 00560 if (ImeUIMakeInfoString(ConTbl, 00561 lpModeInfo)) 00562 { 00563 ConsoleImeSendMessage( ConTbl->hWndCon, 00564 (WPARAM)hwnd, 00565 (LPARAM)&CopyData 00566 ) ; 00567 } 00568 00569 LocalFree( lpModeInfo ); 00570 ImmReleaseContext( hwnd, hIMC ); 00571 return TRUE ; 00572 00573 }

BOOL ImeUISetOpenStatus HWND  hwnd  ) 
 

Definition at line 468 of file consubs.c.

References CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DBGPRINT, _CONSOLE_TABLE::dwConversion, _CONSOLE_TABLE::dwSentence, FALSE, _CONSOLE_TABLE::fOpen, GetOpenStatusByCodepage(), _CONSOLE_TABLE::hWndCon, ImeUIMakeInfoString(), ImmGetContext(), ImmGetConversionStatus(), ImmReleaseContext(), LastConsole, NULL, _CONSOLE_TABLE::ScreenBufferSize, SearchConsole(), and TRUE.

Referenced by ConsoleSetFocus(), ImeUINotify(), and InsertNewConsole().

00471 { 00472 PCONSOLE_TABLE ConTbl; 00473 HIMC hIMC; // Input context handle. 00474 LPCONIME_UIMODEINFO lpModeInfo ; 00475 COPYDATASTRUCT CopyData ; 00476 00477 DBGPRINT(("CONIME: Get IMN_SETOPENSTATUS Message\n")); 00478 00479 ConTbl = SearchConsole(LastConsole); 00480 if (ConTbl == NULL) { 00481 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00482 return FALSE; 00483 } 00484 00485 hIMC = ImmGetContext( hwnd ) ; 00486 if ( hIMC == 0 ) 00487 return FALSE; 00488 00489 ConTbl->fOpen = GetOpenStatusByCodepage( hIMC, ConTbl ) ; 00490 00491 ImmGetConversionStatus(hIMC, 00492 (LPDWORD)&ConTbl->dwConversion, 00493 (LPDWORD)&ConTbl->dwSentence) ; 00494 00495 if (ConTbl->ScreenBufferSize.X != 0) { 00496 00497 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO)) ; 00498 if ( lpModeInfo == NULL) { 00499 ImmReleaseContext( hwnd, hIMC ); 00500 return FALSE; 00501 } 00502 00503 CopyData.dwData = CI_CONIMEMODEINFO ; 00504 CopyData.cbData = sizeof(CONIME_UIMODEINFO) ; 00505 CopyData.lpData = lpModeInfo ; 00506 if (ImeUIMakeInfoString(ConTbl, 00507 lpModeInfo)) 00508 { 00509 ConsoleImeSendMessage( ConTbl->hWndCon, 00510 (WPARAM)hwnd, 00511 (LPARAM)&CopyData 00512 ) ; 00513 } 00514 LocalFree( lpModeInfo ); 00515 } 00516 ImmReleaseContext( hwnd, hIMC ); 00517 00518 return TRUE ; 00519 }

void ImeUIStartComposition HWND  hwnd  ) 
 

Definition at line 67 of file consubs.c.

References DBGPRINT, _CONSOLE_TABLE::fInComposition, FIRSTCOL, LastConsole, MAXCOL, NULL, SearchConsole(), TRUE, and UNICODE_SPACE.

Referenced by WndProc().

00068 { 00069 PCONSOLE_TABLE ConTbl; 00070 00071 ConTbl = SearchConsole(LastConsole); 00072 if (ConTbl == NULL) { 00073 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00074 return; 00075 } 00076 00077 // 00078 // Set fInComposition variables. 00079 // 00080 ConTbl->fInComposition = TRUE; 00081 00082 #ifdef DEBUG_MODE 00083 { 00084 int i ; 00085 for (i = FIRSTCOL ; i < MAXCOL ; i++) { 00086 ConvertLine[i] = UNICODE_SPACE ; 00087 ConvertLineAtr[i] = 0 ; 00088 } 00089 } 00090 #endif 00091 #ifdef DEBUG_INFO 00092 xPos = FIRSTCOL; 00093 xPosLast = FIRSTCOL; 00094 HideCaret( hwnd ); 00095 DisplayConvInformation( hwnd ) ; 00096 ResetCaret( hwnd ); 00097 #endif 00098 }

DWORD ImmCallImeConsoleIME HWND  hWnd,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam,
PUINT  puVKey
 

Definition at line 34 of file ntuser/imm/conime.c.

References BOOL, DWORD, FALSE, GetKeyboardLayout(), GetWindowThreadProcessId(), GUI_VKEY_MASK, HMValidateHandle(), hWnd, tagIMEDPI::ImeInfo, ImmGetContext(), ImmLockImeDpi(), ImmProcessKey(), NULL, NULL_HIMC, PIMEDPI, TYPE_INPUTCONTEXT, UINT, and ValidateHwnd.

Referenced by CharHandlerFromConsole().

00043 : 00044 00045 Called by Console IME to convert Character 00046 This routine copy from user\kernel\ntimm.c :: xxxImmProcessKey 00047 for Console IME could not calls kernel function. 00048 00049 Arguments: 00050 00051 Return Value: 00052 --*/ 00053 { 00054 DWORD dwReturn ; 00055 PIMC pImc ; 00056 HIMC hImc ; 00057 BOOL fDBERoman ; 00058 PWND pwnd ; 00059 PIMEDPI pImeDpi; 00060 HKL hkl ; 00061 00062 dwReturn = 0; 00063 pImc = NULL; 00064 fDBERoman = FALSE; 00065 00066 // 00067 // we're interested in only keyboard messages. 00068 // 00069 if ( Message != WM_KEYDOWN && 00070 Message != WM_SYSKEYDOWN && 00071 Message != WM_KEYUP && 00072 Message != WM_SYSKEYUP ) { 00073 00074 return dwReturn; 00075 } 00076 00077 hkl = GetKeyboardLayout( GetWindowThreadProcessId(hWnd, NULL) ); 00078 pwnd = ValidateHwnd(hWnd); 00079 if ( pwnd == NULL) { 00080 return dwReturn; 00081 } 00082 hImc = ImmGetContext(hWnd); 00083 if ( hImc == NULL_HIMC ){ 00084 return dwReturn; 00085 } 00086 00087 *puVKey = (UINT)wParam & GUI_VKEY_MASK; 00088 00089 // 00090 // Check input context 00091 // 00092 pImc = HMValidateHandle((HANDLE)hImc, TYPE_INPUTCONTEXT); 00093 if ( pImc == NULL ) { 00094 return dwReturn; 00095 } 00096 00097 #ifdef LATER 00098 // 00099 // If there is an easy way to check the input context open/close status 00100 // from the kernel side, IME_PROP_NO_KEYS_ON_CLOSE checking should be 00101 // done here in kernel side. [ 3/10/96 takaok] 00102 // 00103 00104 // 00105 // Check IME_PROP_NO_KEYS_ON_CLOSE bit 00106 // 00107 // if the current imc is not open and IME doesn't need 00108 // keys when being closed, we don't pass any keyboard 00109 // input to ime except hotkey and keys that change 00110 // the keyboard status. 00111 // 00112 if ( (piix->ImeInfo.fdwProperty & IME_PROP_NO_KEYS_ON_CLOSE) && 00113 (!pimc->fdwState & IMC_OPEN) && 00114 uVKey != VK_SHIFT && // 0x10 00115 uVKey != VK_CONTROL && // 0x11 00116 uVKey != VK_CAPITAL && // 0x14 00117 uVKey != VK_KANA && // 0x15 00118 uVKey != VK_NUMLOCK && // 0x90 00119 uVKey != VK_SCROLL ) // 0x91 00120 { 00121 // Check if Korea Hanja conversion mode 00122 if( !(pimc->fdwConvMode & IME_CMODE_HANJACONVERT) ) { 00123 return dwReturn; 00124 } 00125 } 00126 #endif 00127 00128 // 00129 // if the IME doesn't need key up messages, we don't call ime. 00130 // 00131 pImeDpi = ImmLockImeDpi(hkl); 00132 if ( pImeDpi == NULL ) { 00133 return dwReturn; 00134 } 00135 00136 if ( lParam & 0x80000000 && // set if key up, clear if key down 00137 pImeDpi->ImeInfo.fdwProperty & IME_PROP_IGNORE_UPKEYS ) 00138 { 00139 return dwReturn; 00140 } 00141 00142 // 00143 // we don't want to handle sys keys since many functions for 00144 // acceelerators won't work without this 00145 // 00146 fDBERoman = (BOOL)( (*puVKey == VK_DBE_ROMAN) || 00147 (*puVKey == VK_DBE_NOROMAN) || 00148 (*puVKey == VK_DBE_HIRAGANA) || 00149 (*puVKey == VK_DBE_KATAKANA) || 00150 (*puVKey == VK_DBE_CODEINPUT) || 00151 (*puVKey == VK_DBE_NOCODEINPUT) || 00152 (*puVKey == VK_DBE_IME_WORDREGISTER) || 00153 (*puVKey == VK_DBE_IME_DIALOG) ); 00154 00155 if (Message == WM_SYSKEYDOWN || Message == WM_SYSKEYUP ) { 00156 // 00157 // IME may be waiting for VK_MENU, VK_F10 or VK_DBE_xxx 00158 // 00159 if ( *puVKey != VK_MENU && *puVKey != VK_F10 && !fDBERoman ) { 00160 return dwReturn; 00161 } 00162 } 00163 00164 // 00165 // check if the IME doesn't need ALT key 00166 // 00167 00168 if ( !(pImeDpi->ImeInfo.fdwProperty & IME_PROP_NEED_ALTKEY) ) { 00169 // 00170 // IME doesn't need ALT key 00171 // 00172 // we don't pass the ALT and ALT+xxx except VK_DBE_xxx keys. 00173 // 00174 if ( ! fDBERoman && 00175 (*puVKey == VK_MENU || (lParam & 0x20000000)) // KF_ALTDOWN 00176 ) 00177 { 00178 return dwReturn; 00179 } 00180 } 00181 00182 00183 dwReturn = ImmProcessKey(hWnd, hkl, *puVKey, lParam, IME_INVALID_HOTKEY ) ; 00184 return dwReturn; 00185 }

BOOL ImmSetActiveContextConsoleIME HWND  hWnd,
BOOL  fFlag
 

Definition at line 188 of file ntuser/imm/conime.c.

References FALSE, hWnd, ImmGetContext(), ImmSetActiveContext(), and NULL_HIMC.

Referenced by ConsoleKillFocus(), ConsoleSetFocus(), and SetNLSMode().

00195 : 00196 00197 Set this context as active one. 00198 00199 Arguments: 00200 00201 hWnd - the get focus window 00202 fFlag - get focus or kill focus 00203 00204 Return Value: 00205 00206 --*/ 00207 00208 { 00209 HIMC hImc; 00210 00211 hImc = ImmGetContext(hWnd) ; 00212 if (hImc == NULL_HIMC) { 00213 return FALSE; 00214 } 00215 return(ImmSetActiveContext(hWnd, hImc, fFlag)) ; 00216 00217 }

BOOL ImmTranslateMessage HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 196 of file ntuser/imm/input.c.

Referenced by _InitializeImmEntryTable().

00201 { 00202 HIMC hImc; 00203 PINPUTCONTEXT pInputContext; 00204 BOOL fReturn = FALSE; 00205 HKL hkl; 00206 PIMEDPI pImeDpi = NULL; 00207 PBYTE pbKeyState; 00208 PTRANSMSG pTransMsg; 00209 PTRANSMSGLIST pTransMsgList; 00210 DWORD dwSize; 00211 UINT uVKey; 00212 INT iNum; 00213 00214 UNREFERENCED_PARAMETER(wParam); 00215 00216 // 00217 // we're interested in only those keyboard messages. 00218 // 00219 switch (message) { 00220 case WM_KEYDOWN: 00221 case WM_KEYUP: 00222 case WM_SYSKEYDOWN: 00223 case WM_SYSKEYUP: 00224 break; 00225 default: 00226 return FALSE; 00227 } 00228 00229 // 00230 // input context is necessary for further handling 00231 // 00232 hImc = ImmGetContext(hwnd); 00233 pInputContext = ImmLockIMC(hImc); 00234 if (pInputContext == NULL) { 00235 ImmReleaseContext(hwnd, hImc); 00236 return FALSE; 00237 } 00238 00239 // 00240 // At first, handle VK_PROCESSKEY generated by IME. 00241 // 00242 if (!pInputContext->fChgMsg) { 00243 00244 if ((iNum=pInputContext->dwNumMsgBuf) != 0) { 00245 00246 pTransMsg = (PTRANSMSG)ImmLockIMCC(pInputContext->hMsgBuf); 00247 if (pTransMsg != NULL) { 00248 ImmPostMessages(hwnd, hImc, iNum, pTransMsg); 00249 ImmUnlockIMCC(pInputContext->hMsgBuf); 00250 fReturn = TRUE; 00251 } 00252 00253 pInputContext->dwNumMsgBuf = 0; 00254 } 00255 goto ExitITM; 00256 } 00257 00258 pInputContext->fChgMsg = FALSE; 00259 00260 // 00261 // retrieve the keyboard layout and IME entry points 00262 // 00263 hkl = GetKeyboardLayout( GetWindowThreadProcessId(hwnd, NULL) ); 00264 pImeDpi = ImmLockImeDpi(hkl); 00265 if (pImeDpi == NULL) { 00266 RIPMSG1(RIP_WARNING, "ImmTranslateMessage pImeDpi is NULL(hkl=%x)", hkl); 00267 goto ExitITM; 00268 } 00269 00270 pbKeyState = ImmLocalAlloc(0, 256); 00271 if ( pbKeyState == NULL ) { 00272 RIPMSG0(RIP_WARNING, "ImmTranslateMessage out of memory" ); 00273 goto ExitITM; 00274 } 00275 00276 if (!GetKeyboardState(pbKeyState)) { 00277 RIPMSG0(RIP_WARNING, "ImmTranslateMessage GetKeyboardState() failed" ); 00278 ImmLocalFree( pbKeyState ); 00279 goto ExitITM; 00280 } 00281 00282 // 00283 // Translate the saved vkey into character code if needed 00284 // 00285 uVKey = pInputContext->uSavedVKey; 00286 00287 if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_KBD_CHAR_FIRST) { 00288 00289 if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) { 00290 WCHAR wcTemp; 00291 00292 iNum = ToUnicode(pInputContext->uSavedVKey, // virtual-key code 00293 HIWORD(lParam), // scan code 00294 pbKeyState, // key-state array 00295 &wcTemp, // buffer for translated key 00296 1, // size of buffer 00297 0); 00298 if (iNum == 1) { 00299 // 00300 // hi word : unicode character code 00301 // hi byte of lo word : zero 00302 // lo byte of lo word : virtual key 00303 // 00304 uVKey = (uVKey & 0x00ff) | ((UINT)wcTemp << 16); 00305 } 00306 00307 } else { 00308 WORD wTemp = 0; 00309 00310 iNum = ToAsciiEx(pInputContext->uSavedVKey, // virtual-key code 00311 HIWORD(lParam), // scan code 00312 pbKeyState, // key-state array 00313 &wTemp, // buffer for translated key 00314 0, // active-menu flag 00315 hkl); 00316 ImmAssert(iNum <= 2); 00317 if (iNum > 0) { 00318 // 00319 // hi word : should be zero 00320 // hi byte of lo word : character code 00321 // lo byte of lo word : virtual key 00322 // 00323 uVKey = (uVKey & 0x00FF) | ((UINT)wTemp << 8); 00324 00325 if ((BYTE)uVKey == VK_PACKET) { 00326 // 00327 // If ANSI IME is wide vkey aware, its ImeToAsciiEx will receive the uVKey 00328 // as follows: 00329 // 00330 // 31 24 23 16 15 8 7 0 00331 // +----------------+-----------------------------+-------------------+---------------+ 00332 // | 24~31:reserved | 16~23:trailing byte(if any) | 8~15:leading byte | 0~7:VK_PACKET | 00333 // +----------------+-----------------------------+-------------------+---------------+ 00334 // 00335 ImmAssert(pImeDpi->ImeInfo.fdwProperty & IME_PROP_ACCEPT_WIDE_VKEY); 00336 } 00337 else { 00338 uVKey &= 0xffff; 00339 } 00340 } 00341 } 00342 } 00343 00344 dwSize = FIELD_OFFSET(TRANSMSGLIST, TransMsg) 00345 + TRANSMSGCOUNT * sizeof(TRANSMSG); 00346 00347 pTransMsgList = (PTRANSMSGLIST)ImmLocalAlloc(0, dwSize); 00348 00349 if (pTransMsgList == NULL) { 00350 RIPMSG0(RIP_WARNING, "ImmTranslateMessage out of memory" ); 00351 ImmLocalFree(pbKeyState); 00352 goto ExitITM; 00353 } 00354 00355 pTransMsgList->uMsgCount = TRANSMSGCOUNT; 00356 iNum = (*pImeDpi->pfn.ImeToAsciiEx)(uVKey, 00357 HIWORD(lParam), 00358 pbKeyState, 00359 pTransMsgList, 00360 0, 00361 hImc); 00362 00363 if (iNum > TRANSMSGCOUNT) { 00364 00365 // 00366 // The message buffer is not big enough. IME put messages 00367 // into hMsgBuf in the input context. 00368 // 00369 00370 pTransMsg = (PTRANSMSG)ImmLockIMCC(pInputContext->hMsgBuf); 00371 if (pTransMsg != NULL) { 00372 ImmPostMessages(hwnd, hImc, iNum, pTransMsg); 00373 ImmUnlockIMCC(pInputContext->hMsgBuf); 00374 } 00375 00376 #ifdef LATER 00377 // Shouldn't we need this ? 00378 fReturn = TRUE; 00379 #endif 00380 00381 } else if (iNum > 0) { 00382 ImmPostMessages(hwnd, hImc, iNum, &pTransMsgList->TransMsg[0]); 00383 fReturn = TRUE; 00384 } 00385 00386 ImmLocalFree(pbKeyState); 00387 ImmLocalFree(pTransMsgList); 00388 00389 ExitITM: 00390 ImmUnlockImeDpi(pImeDpi); 00391 ImmUnlockIMC(hImc); 00392 ImmReleaseContext(hwnd, hImc); 00393 00394 return fReturn; 00395 }

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 InitConsoleIME HINSTANCE  hInstance  ) 
 

Definition at line 109 of file ntcon/conime/conime.c.

References CONSOLE_INITIAL_TABLE, CONSOLEIME_EVENT, ConsoleTable, ConsoleTableLock, CVMAX, DBGPRINT, DestroyWindow, dwConsoleThreadId, ErrorExit(), FALSE, GetSystemMetrics(), hWnd, ID_CONSOLEIME_ICON, IDS_APPNAME, IDS_CLASSNAME, IDS_MENUNAME, IDS_TITLE, L, LPVOID, NULL, NumberOfConsoleTable, PCONSOLE_TABLE, RegisterClass, RtlInitializeCriticalSection(), SetWindowText(), ShowWindow, szTitle, TRUE, UNICODE_SPACE, UnregisterClass(), UpdateWindow(), and WndProc().

Referenced by WinMain().

00112 { 00113 HANDLE hEvent; 00114 ATOM atom; 00115 HWND hWnd; 00116 WNDCLASS ConsoleIMEClass; 00117 int cxExecStart; 00118 int cyExecStart; 00119 WCHAR szMenuName[16]; // The name of Menu 00120 WCHAR szClassName[16]; // The class name of this application 00121 WCHAR szTitle[16]; // The title bar text 00122 00123 #ifdef DEBUG_MODE 00124 WCHAR szAppName[16]; // The name of this application 00125 00126 LoadString(hInstance, IDS_TITLE, szTitle, sizeof(szTitle)); 00127 #else 00128 szTitle[0] = L'\0'; 00129 #endif 00130 00131 DBGPRINT(("CONIME: Enter InitConsoleIMEl!\n")); 00132 00133 RtlInitializeCriticalSection(&ConsoleTableLock); 00134 00135 ConsoleTable = (PCONSOLE_TABLE *)LocalAlloc(LPTR, CONSOLE_INITIAL_TABLE * sizeof(PCONSOLE_TABLE)); 00136 if (ConsoleTable == NULL) { 00137 return FALSE; 00138 } 00139 RtlZeroMemory(ConsoleTable, CONSOLE_INITIAL_TABLE * sizeof(PCONSOLE_TABLE)); 00140 NumberOfConsoleTable = CONSOLE_INITIAL_TABLE; 00141 00142 // Load the application name and description strings. 00143 LoadString(hInstance, IDS_MENUNAME, szMenuName, sizeof(szMenuName)); 00144 LoadString(hInstance, IDS_CLASSNAME, szClassName, sizeof(szClassName)); 00145 00146 hEvent = OpenEvent(EVENT_MODIFY_STATE, // Access flag 00147 FALSE, // Inherit 00148 CONSOLEIME_EVENT); // Event object name 00149 if (hEvent == NULL) 00150 { 00151 DBGPRINT(("CONIME: OpenEvent failure! %d\n",GetLastError())); 00152 goto ErrorExit; 00153 } 00154 00155 // Fill in window class structure with parameters that describe the 00156 // main window. 00157 00158 ConsoleIMEClass.style = 0; // Class style(s). 00159 ConsoleIMEClass.lpfnWndProc = WndProc; // Window Procedure 00160 ConsoleIMEClass.cbClsExtra = 0; // No per-class extra data. 00161 ConsoleIMEClass.cbWndExtra = 0; // No per-window extra data. 00162 ConsoleIMEClass.hInstance = hInstance; // Owner of this class 00163 ConsoleIMEClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(ID_CONSOLEIME_ICON)); 00164 ConsoleIMEClass.hCursor = LoadCursor(NULL, IDC_ARROW); // Cursor 00165 ConsoleIMEClass.hbrBackground = GetStockObject(WHITE_BRUSH); // Default color 00166 ConsoleIMEClass.lpszMenuName = szMenuName; // Menu name from .RC 00167 ConsoleIMEClass.lpszClassName = szClassName; // Class Name 00168 00169 // Register the window class and return FALSE if unsuccesful. 00170 00171 atom = RegisterClass(&ConsoleIMEClass); 00172 if (atom == 0) 00173 { 00174 DBGPRINT(("CONIME: RegisterClass failure! %d\n",GetLastError())); 00175 goto ErrorExit; 00176 } 00177 else { 00178 DBGPRINT(("CONIME: RegisterClass Successful!\n")); 00179 } 00180 00181 // Guess size for now. 00182 cxExecStart = GetSystemMetrics(SM_CXSCREEN); 00183 cyExecStart = GetSystemMetrics(SM_CYMENU); 00184 00185 // Create a main window for this application instance. 00186 hWnd = CreateWindow(szClassName, // See RegisterClass() call. 00187 szTitle, // Text for window title bar. 00188 WS_OVERLAPPEDWINDOW, 00189 cxExecStart - (cxExecStart / 3) , 00190 cyExecStart , 00191 cxExecStart / 3 , 00192 cyExecStart * 10 , 00193 NULL, // Overlapped has no parent. 00194 NULL, // Use the window class menu. 00195 hInstance, 00196 (LPVOID)NULL); 00197 00198 // If window could not be created, return "failure" 00199 if (hWnd == NULL) { 00200 DBGPRINT(("CONIME: CreateWindow failured! %d\n",GetLastError())); 00201 goto ErrorExit; 00202 } 00203 else{ 00204 DBGPRINT(("CONIME: CreateWindow Successful!\n")); 00205 } 00206 00207 if (! RegisterConsoleIME(hWnd, &dwConsoleThreadId)) 00208 { 00209 DBGPRINT(("CONIME: RegisterConsoleIME failured! %d\n",GetLastError())); 00210 goto ErrorExit; 00211 } 00212 00213 if (! AttachThreadInput(GetCurrentThreadId(), dwConsoleThreadId, TRUE)) 00214 { 00215 DBGPRINT(("CONIME: AttachThreadInput failured! %d\n",GetLastError())); 00216 goto ErrorExit; 00217 } 00218 00219 /* 00220 * dwConsoleThreadId is locked until event sets of hEvent 00221 */ 00222 SetEvent(hEvent); 00223 CloseHandle(hEvent); 00224 00225 #ifdef DEBUG_MODE 00226 LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName)); 00227 00228 // Make the window visible; update its client area; and return "success" 00229 ShowWindow(hWnd, SW_MINIMIZE); // Show the window 00230 SetWindowText(hWnd, szAppName); 00231 UpdateWindow(hWnd); // Sends WM_PAINT message 00232 00233 { 00234 int i; 00235 00236 for (i = 0; i < CVMAX; i++) { 00237 ConvertLine[i] = UNICODE_SPACE; 00238 ConvertLineAtr[i] = 0; 00239 } 00240 xPos = 0; 00241 xPosLast = 0; 00242 } 00243 00244 #endif 00245 00246 return TRUE; // We succeeded... 00247 00248 ErrorExit: 00249 if (dwConsoleThreadId) 00250 UnregisterConsoleIME(); 00251 if (hWnd) 00252 DestroyWindow(hWnd); 00253 if (atom) 00254 UnregisterClass(szClassName,hInstance); 00255 if (hEvent) 00256 { 00257 SetEvent(hEvent); 00258 CloseHandle(hEvent); 00259 } 00260 return FALSE; 00261 }

BOOL InputLangchange HWND  hWnd,
DWORD  CharSet,
HKL  hkl
 

Definition at line 1202 of file ntcon/conime/conime.c.

References ActivateKeyboardLayout, DBGPRINT, FALSE, GetIMEName(), _CONSOLE_TABLE::hklActive, hWnd, ImeUIOpenStatusWindow(), LastConsole, NULL, SearchConsole(), and TRUE.

Referenced by WndProc().

01207 { 01208 PCONSOLE_TABLE ConTbl; 01209 01210 ConTbl = SearchConsole(LastConsole); 01211 if (ConTbl == NULL) { 01212 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 01213 return FALSE; 01214 } 01215 01216 ConTbl->hklActive = hkl; 01217 ActivateKeyboardLayout(ConTbl->hklActive, 0); 01218 GetIMEName( ConTbl ); 01219 ImeUIOpenStatusWindow(hWnd); 01220 return TRUE; 01221 }

BOOL InsertConsole HWND  hWnd,
HANDLE  hConsole,
HWND  hWndConsole
 

Definition at line 664 of file ntcon/conime/conime.c.

References _CONSOLE_TABLE::CompAttrColor, CONSOLE_TABLE, ConsoleTable, DBGPRINT, DEFAULT_COMP_ALREADY_CONVERTED, DEFAULT_COMP_CONVERSION, DEFAULT_COMP_ENTERED, DEFAULT_COMP_INPUT_ERROR, DEFAULT_COMP_YET_CONVERTED, DEFAULT_TEMP_WIDTH, _CONSOLE_TABLE::Enable, FALSE, GetIMEName(), GrowConsoleTable(), _CONSOLE_TABLE::hConsole, _CONSOLE_TABLE::hIMC_Current, _CONSOLE_TABLE::hIMC_Original, HKL_INITIAL_TABLE, HKL_TABLE, _CONSOLE_TABLE::hklListMax, hWnd, _CONSOLE_TABLE::hWndCon, ImmCreateContext(), _CONSOLE_TABLE::LateRemove, _CONSOLE_TABLE::lphklList, NULL, NumberOfConsoleTable, RemoveConsoleWorker(), _CONSOLE_TABLE::ScreenBufferSize, and TRUE.

Referenced by InsertNewConsole().

00669 { 00670 ULONG i; 00671 PCONSOLE_TABLE FocusedConsole; 00672 00673 i = 1; 00674 00675 do { 00676 for (; i < NumberOfConsoleTable; i++) { 00677 FocusedConsole = ConsoleTable[i]; 00678 00679 if (FocusedConsole == NULL) 00680 { 00681 FocusedConsole = LocalAlloc(LPTR, sizeof(CONSOLE_TABLE)); 00682 if (FocusedConsole == NULL) 00683 return FALSE; 00684 ConsoleTable[i] = FocusedConsole; 00685 } 00686 00687 if ((FocusedConsole->hConsole != NULL) && 00688 (FocusedConsole->LateRemove)&& 00689 (FocusedConsole->Enable)) { 00690 RemoveConsoleWorker(hWnd, FocusedConsole); 00691 } 00692 00693 if (FocusedConsole->hConsole == NULL) { 00694 RtlZeroMemory(FocusedConsole, sizeof(CONSOLE_TABLE)); 00695 FocusedConsole->lphklList = LocalAlloc(LPTR, sizeof(HKL_TABLE)*HKL_INITIAL_TABLE); 00696 if (FocusedConsole->lphklList == NULL) 00697 { 00698 return FALSE; 00699 } 00700 RtlZeroMemory(FocusedConsole->lphklList, sizeof(HKL_TABLE)*HKL_INITIAL_TABLE); 00701 FocusedConsole->hklListMax = HKL_INITIAL_TABLE ; 00702 00703 FocusedConsole->hIMC_Current = ImmCreateContext(); 00704 if (FocusedConsole->hIMC_Current == (HIMC)NULL) { 00705 LocalFree(FocusedConsole); 00706 FocusedConsole = NULL; 00707 return FALSE; 00708 } 00709 00710 FocusedConsole->hIMC_Original = FocusedConsole->hIMC_Current; 00711 FocusedConsole->hConsole = hConsole; 00712 FocusedConsole->hWndCon = hWndConsole; 00713 // FocusedConsole->hklActive = NULL; 00714 FocusedConsole->Enable = TRUE; 00715 // FocusedConsole->LateRemove = FALSE; 00716 // FocusedConsole->fNestCandidate = FALSE; 00717 // FocusedConsole->fInComposition = FALSE; 00718 // FocusedConsole->fInCandidate = FALSE; 00719 FocusedConsole->ScreenBufferSize.X = DEFAULT_TEMP_WIDTH; 00720 00721 FocusedConsole->CompAttrColor[0] = DEFAULT_COMP_ENTERED; 00722 FocusedConsole->CompAttrColor[1] = DEFAULT_COMP_ALREADY_CONVERTED; 00723 FocusedConsole->CompAttrColor[2] = DEFAULT_COMP_CONVERSION; 00724 FocusedConsole->CompAttrColor[3] = DEFAULT_COMP_YET_CONVERTED; 00725 FocusedConsole->CompAttrColor[4] = DEFAULT_COMP_INPUT_ERROR; 00726 FocusedConsole->CompAttrColor[5] = DEFAULT_COMP_INPUT_ERROR; 00727 FocusedConsole->CompAttrColor[6] = DEFAULT_COMP_INPUT_ERROR; 00728 FocusedConsole->CompAttrColor[7] = DEFAULT_COMP_INPUT_ERROR; 00729 00730 GetIMEName(FocusedConsole); 00731 00732 return TRUE; 00733 } 00734 } 00735 } while (GrowConsoleTable()); 00736 00737 DBGPRINT(("CONIME: Cannot grow Console Table\n")); 00738 return FALSE; 00739 }

BOOL InsertNewConsole HWND  hWnd,
HANDLE  hConsole,
HWND  hWndConsole
 

Definition at line 869 of file ntcon/conime/conime.c.

References FALSE, hWnd, ImeUISetOpenStatus(), InsertConsole(), LockConsoleTable, NULL, SearchConsole(), TRUE, and UnlockConsoleTable.

Referenced by WndProc().

00874 { 00875 // conime receive ime message from console before 1st console registered. 00876 // this will happen after restart conime when conime dead by bogus ime's AV or 00877 // other problem 00878 // so this fail safe code is necessary to protect consrv. 00879 if (SearchConsole(hConsole) != NULL) { 00880 return TRUE; 00881 } 00882 00883 LockConsoleTable(); 00884 00885 if (!InsertConsole(hWnd, hConsole, hWndConsole)) { 00886 UnlockConsoleTable(); 00887 return FALSE; 00888 } 00889 00890 #ifdef DEBUG_MODE 00891 DisplayInformation(hWnd, hConsole); 00892 #endif 00893 00894 ImeUISetOpenStatus( hWndConsole ); 00895 00896 UnlockConsoleTable(); 00897 00898 return TRUE; 00899 }

BOOL IsDBCSTrailByte char *  base,
char *  p
 

BOOL IsUnicodeFullWidth IN WCHAR  wch  ) 
 

Definition at line 312 of file consubs.c.

References ASSERT, BOOL, FALSE, INT, RtlUnicodeToMultiByteSize(), and TRUE.

Referenced by DispLenStructedUnicode(), DispLenUnicode(), GetSystemLineJ(), GetSystemLineP(), GetSystemLineT(), IncludeCandidateP(), MakeStatusStrPRC1(), MakeStatusStrPRC2(), MakeStatusStrTaiwan1(), MakeStatusStrTaiwan2(), and WndProc().

00315 { 00316 if (0x20 <= wch && wch <= 0x7e) 00317 /* ASCII */ 00318 return FALSE; 00319 else if (0x3041 <= wch && wch <= 0x3094) 00320 /* Hiragana */ 00321 return TRUE; 00322 else if (0x30a1 <= wch && wch <= 0x30f6) 00323 /* Katakana */ 00324 return TRUE; 00325 else if (0x3105 <= wch && wch <= 0x312c) 00326 /* Bopomofo */ 00327 return TRUE; 00328 else if (0x3131 <= wch && wch <= 0x318e) 00329 /* Hangul Elements */ 00330 return TRUE; 00331 else if (0xac00 <= wch && wch <= 0xd7a3) 00332 /* Korean Hangul Syllables */ 00333 return TRUE; 00334 else if (0xff01 <= wch && wch <= 0xff5e) 00335 /* Fullwidth ASCII variants */ 00336 return TRUE; 00337 else if (0xff61 <= wch && wch <= 0xff9f) 00338 /* Halfwidth Katakana variants */ 00339 return FALSE; 00340 else if ( (0xffa0 <= wch && wch <= 0xffbe) || 00341 (0xffc2 <= wch && wch <= 0xffc7) || 00342 (0xffca <= wch && wch <= 0xffcf) || 00343 (0xffd2 <= wch && wch <= 0xffd7) || 00344 (0xffda <= wch && wch <= 0xffdc) ) 00345 /* Halfwidth Hangule variants */ 00346 return FALSE; 00347 else if (0xffe0 <= wch && wch <= 0xffe6) 00348 /* Fullwidth symbol variants */ 00349 return TRUE; 00350 else if (0x4e00 <= wch && wch <= 0x9fa5) 00351 /* Han Ideographic */ 00352 return TRUE; 00353 else if (0xf900 <= wch && wch <= 0xfa2d) 00354 /* Han Ideographic Compatibility */ 00355 return TRUE; 00356 else 00357 { 00358 #if 0 00359 /* 00360 * Hack this block for I don't know FONT of Console Window. 00361 * 00362 * If you would like perfect result from IsUnicodeFullWidth routine, 00363 * then you should enable this block and 00364 * you should know FONT of Console Window. 00365 */ 00366 00367 INT Width; 00368 TEXTMETRIC tmi; 00369 00370 /* Unknown character */ 00371 00372 GetTextMetricsW(hDC, &tmi); 00373 if (IS_ANY_DBCS_CHARSET(tmi.tmCharSet)) 00374 tmi.tmMaxCharWidth /= 2; 00375 00376 GetCharWidth32(hDC, wch, wch, &Width); 00377 if (Width == tmi.tmMaxCharWidth) 00378 return FALSE; 00379 else if (Width == tmi.tmMaxCharWidth*2) 00380 return TRUE; 00381 #else 00382 ULONG MultiByteSize; 00383 00384 RtlUnicodeToMultiByteSize(&MultiByteSize, &wch, sizeof(WCHAR)); 00385 if (MultiByteSize == 2) 00386 return TRUE ; 00387 else 00388 return FALSE ; 00389 #endif 00390 } 00391 ASSERT(FALSE); 00392 return FALSE; 00393 #if 0 00394 ULONG MultiByteSize; 00395 00396 RtlUnicodeToMultiByteSize(&MultiByteSize, &wch, sizeof(WCHAR)); 00397 if (MultiByteSize == 2) 00398 return TRUE ; 00399 else 00400 return FALSE ; 00401 #endif 00402 }

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 }

VOID NumString LPWSTR  StrToWrite,
DWORD  NumToDisp,
DWORD  CountDispWidth
 

Definition at line 1182 of file country2.c.

References DWORD, UNICODE_SLASH, UNICODE_SPACE, UNICODE_ZERO, and USHORT.

Referenced by GetSystemLineJ(), GetSystemLineP(), and GetSystemLineT().

01186 { 01187 DWORD i; 01188 DWORD k; 01189 k = 1; 01190 for (i = 1; i < CountDispWidth; i++) 01191 k *= 10; 01192 for (i = k; i > 0; i /= 10){ 01193 k = (NumToDisp / i); 01194 *StrToWrite = (USHORT)(k + UNICODE_ZERO); 01195 if ((*StrToWrite == UNICODE_ZERO) && 01196 ((*(StrToWrite-1) == UNICODE_SPACE)||(*(StrToWrite-1) == UNICODE_SLASH)) ) 01197 *StrToWrite = UNICODE_SPACE; 01198 StrToWrite++; 01199 NumToDisp -= (i*k); 01200 } 01201 }

BOOL OpenCandidateJapan HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList,
BOOL  OpenFlag
 

Definition at line 80 of file country2.c.

References _CONIME_CANDMESSAGE::AttrOff, BOOL, _CONSOLE_TABLE::CandListMemAllocSize, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandOff, _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::CandSepAllocSize, CI_CONIMECANDINFO, CODEDISPLEN, ConsoleImeSendMessage(), DEFAULTCANDTABLE, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::fNestCandidate, GetSystemLineJ(), _CONSOLE_TABLE::hWndCon, ImmNotifyIME(), _CONSOLE_TABLE::lpCandListMem, MAX_LISTCAND, NULL, _CONSOLE_TABLE::ScreenBufferSize, _CONIME_CANDMESSAGE::String, _CONSOLE_TABLE::SystemLine, _CONSOLE_TABLE::SystemLineSize, and TRUE.

Referenced by ImeUIOpenCandidate().

00087 { 00088 DWORD dwLength; 00089 DWORD dwIndex; 00090 DWORD i; 00091 DWORD j; 00092 LPWSTR lpStr; 00093 DWORD dwDspLen; 00094 DWORD width; 00095 DWORD StartIndex; 00096 DWORD CountDispWidth; 00097 DWORD AllocLength; 00098 LPCANDIDATELIST lpCandList; 00099 LPCONIME_CANDMESSAGE SystemLine; 00100 DWORD SystemLineSize; 00101 COPYDATASTRUCT CopyData; 00102 BOOL EnableCodePoint; 00103 00104 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 00105 if ( CandList & ( 1 << dwIndex ) ) { 00106 dwLength = ImmGetCandidateList(hIMC, dwIndex, NULL, 0); 00107 if (dwLength == 0) 00108 return FALSE; 00109 if ( (ConTbl->CandListMemAllocSize[dwIndex] != dwLength ) && 00110 (ConTbl->lpCandListMem[dwIndex] != NULL)) { 00111 LocalFree(ConTbl->lpCandListMem[dwIndex]); 00112 ConTbl->CandListMemAllocSize[dwIndex] = 0; 00113 ConTbl->lpCandListMem[dwIndex] = NULL; 00114 } 00115 if (ConTbl->lpCandListMem[dwIndex] == NULL) { 00116 ConTbl->lpCandListMem[dwIndex] = LocalAlloc(LPTR, dwLength); 00117 if (ConTbl->lpCandListMem[dwIndex] == NULL) 00118 return FALSE; 00119 ConTbl->CandListMemAllocSize[dwIndex] = dwLength; 00120 } 00121 lpCandList = ConTbl->lpCandListMem[dwIndex]; 00122 ImmGetCandidateList(hIMC, dwIndex, lpCandList, dwLength); 00123 00124 // 00125 // check each offset value is not over than buffer size. 00126 // 00127 if ((lpCandList->dwCount > 1) && 00128 (lpCandList->dwSelection >= dwLength || 00129 lpCandList->dwPageStart >= dwLength || 00130 lpCandList->dwOffset[lpCandList->dwSelection] >= dwLength || 00131 lpCandList->dwOffset[lpCandList->dwPageStart] >= dwLength ) 00132 ) 00133 break; 00134 00135 dwLength = ConTbl->ScreenBufferSize.X; 00136 dwLength = (dwLength > 128) ? 128 : dwLength ; 00137 dwLength = ((dwLength < 12) ? 12 : dwLength ); 00138 00139 j = (dwLength-7)/(DELIMITERWIDTH+sizeof(WCHAR)); 00140 j = ((j > 9)?9:j); 00141 j = lpCandList->dwCount / j + 10; 00142 AllocLength = (j > DEFAULTCANDTABLE) ? j : DEFAULTCANDTABLE; 00143 00144 if (lpCandList->dwStyle == IME_CAND_CODE){ 00145 EnableCodePoint = TRUE; 00146 } 00147 else{ 00148 EnableCodePoint = FALSE; 00149 } 00150 00151 if (EnableCodePoint){ 00152 CountDispWidth = CODEDISPLEN; 00153 } 00154 else { 00155 for (CountDispWidth = 0 ,j = 1; j <= lpCandList->dwCount; CountDispWidth++) 00156 j *= 10; 00157 CountDispWidth *= 2; 00158 CountDispWidth++; 00159 } 00160 00161 if ((ConTbl->CandSepAllocSize != sizeof(DWORD)*AllocLength) && 00162 (ConTbl->CandSep != NULL)) { 00163 LocalFree(ConTbl->CandSep); 00164 ConTbl->CandSep = NULL; 00165 ConTbl->CandSepAllocSize = 0; 00166 } 00167 if (ConTbl->CandSep == NULL) { 00168 ConTbl->CandSep= LocalAlloc(LPTR, sizeof(DWORD)*AllocLength); 00169 if (ConTbl->CandSep == NULL) 00170 return FALSE; 00171 ConTbl->CandSepAllocSize = sizeof(DWORD)*AllocLength; 00172 } 00173 00174 if ( EnableCodePoint ){ 00175 j = 0; 00176 ConTbl->CandSep[j++] = 0; 00177 if (OpenFlag) { 00178 ConTbl->CandOff = lpCandList->dwSelection % 9; 00179 } 00180 i = ConTbl->CandOff; 00181 for (; i < lpCandList->dwCount; i+= 9 ) { 00182 ConTbl->CandSep[j++] = i; 00183 } 00184 if (i > lpCandList->dwCount) { 00185 i = lpCandList->dwCount; 00186 } 00187 } 00188 else{ 00189 j = 0; 00190 if (OpenFlag) { 00191 ConTbl->CandOff = 0; 00192 } 00193 ConTbl->CandSep[j++] = ConTbl->CandOff; 00194 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ 0 ]); 00195 dwDspLen = DispLenUnicode( lpStr ); 00196 width = dwDspLen + DELIMITERWIDTH; // '1:xxxx 2:xxxx ' 00197 for( i = 1; i < lpCandList->dwCount; i++ ) { 00198 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 00199 dwDspLen = DispLenUnicode( lpStr ); 00200 width += dwDspLen + DELIMITERWIDTH; 00201 if ((width > dwLength-CountDispWidth) || 00202 ( i - ConTbl->CandSep[j-1] >= 9)){ 00203 ConTbl->CandSep[j++] = i; 00204 width = dwDspLen + DELIMITERWIDTH; 00205 } 00206 } 00207 } 00208 ConTbl->CandSep[j] = i; 00209 ConTbl->CandMax = j; 00210 00211 SystemLineSize = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00212 if (ConTbl->SystemLineSize < SystemLineSize ){ 00213 if (ConTbl->SystemLine != NULL){ 00214 LocalFree( ConTbl->SystemLine ); 00215 ConTbl->SystemLine = NULL; 00216 ConTbl->SystemLineSize = 0; 00217 } 00218 ConTbl->SystemLine = (LPCONIME_CANDMESSAGE)LocalAlloc(LPTR, SystemLineSize ); 00219 if (ConTbl->SystemLine == NULL) { 00220 return FALSE; 00221 } 00222 ConTbl->SystemLineSize = SystemLineSize; 00223 } 00224 SystemLine = ConTbl->SystemLine; 00225 00226 SystemLine->AttrOff = sizeof(WCHAR) * dwLength + sizeof(DWORD); 00227 00228 CopyData.dwData = CI_CONIMECANDINFO; 00229 CopyData.cbData = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00230 CopyData.lpData = SystemLine; 00231 StartIndex = GetSystemLineJ( lpCandList, 00232 SystemLine->String, 00233 (LPSTR)SystemLine + SystemLine->AttrOff, 00234 dwLength, 00235 CountDispWidth, 00236 ConTbl, 00237 EnableCodePoint); 00238 00239 ConTbl->fNestCandidate = TRUE; // ImmNotyfyIME call back OpenCandidate Message 00240 // by same data. 00241 // so We ignore this mesage. 00242 ImmNotifyIME(hIMC, 00243 NI_SETCANDIDATE_PAGESTART, 00244 dwIndex, 00245 ConTbl->CandSep[StartIndex]); 00246 00247 ImmNotifyIME(hIMC, 00248 NI_SETCANDIDATE_PAGESIZE, 00249 dwIndex, 00250 ConTbl->CandSep[StartIndex+1] - 00251 ConTbl->CandSep[StartIndex]); 00252 ConTbl->fNestCandidate = FALSE; 00253 00254 ConsoleImeSendMessage( ConTbl->hWndCon, 00255 (WPARAM)hwnd, 00256 (LPARAM)&CopyData 00257 ); 00258 } 00259 } 00260 return TRUE; 00261 }

BOOL OpenCandidateKorea HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList,
BOOL  OpenFlag
 

Definition at line 606 of file country2.c.

References _CONIME_CANDMESSAGE::AttrOff, BOOL, _CONSOLE_TABLE::CandListMemAllocSize, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandOff, _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::CandSepAllocSize, CI_CONIMECANDINFO, CODEDISPLEN, ConsoleImeSendMessage(), DEFAULTCANDTABLE, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::fNestCandidate, GetSystemLineJ(), _CONSOLE_TABLE::hWndCon, ImmNotifyIME(), _CONSOLE_TABLE::lpCandListMem, MAX_LISTCAND, NULL, _CONSOLE_TABLE::ScreenBufferSize, _CONIME_CANDMESSAGE::String, _CONSOLE_TABLE::SystemLine, _CONSOLE_TABLE::SystemLineSize, and TRUE.

Referenced by ImeUIOpenCandidate().

00613 { 00614 DWORD dwLength; 00615 DWORD dwIndex; 00616 DWORD i; 00617 DWORD j; 00618 LPWSTR lpStr; 00619 DWORD dwDspLen; 00620 DWORD width; 00621 DWORD StartIndex; 00622 DWORD CountDispWidth; 00623 DWORD AllocLength; 00624 LPCANDIDATELIST lpCandList; 00625 LPCONIME_CANDMESSAGE SystemLine; 00626 DWORD SystemLineSize; 00627 COPYDATASTRUCT CopyData; 00628 BOOL EnableCodePoint; 00629 00630 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 00631 if ( CandList & ( 1 << dwIndex ) ) { 00632 dwLength = ImmGetCandidateList(hIMC, dwIndex, NULL, 0); 00633 if (dwLength == 0) 00634 return FALSE; 00635 if ( (ConTbl->CandListMemAllocSize[dwIndex] != dwLength ) && 00636 (ConTbl->lpCandListMem[dwIndex] != NULL)) { 00637 LocalFree(ConTbl->lpCandListMem[dwIndex]); 00638 ConTbl->CandListMemAllocSize[dwIndex] = 0; 00639 ConTbl->lpCandListMem[dwIndex] = NULL; 00640 } 00641 if (ConTbl->lpCandListMem[dwIndex] == NULL) { 00642 ConTbl->lpCandListMem[dwIndex] = LocalAlloc(LPTR, dwLength); 00643 if (ConTbl->lpCandListMem[dwIndex] == NULL) 00644 return FALSE; 00645 ConTbl->CandListMemAllocSize[dwIndex] = dwLength; 00646 } 00647 lpCandList = ConTbl->lpCandListMem[dwIndex]; 00648 ImmGetCandidateList(hIMC, dwIndex, lpCandList, dwLength); 00649 00650 // 00651 // check each offset value is not over than buffer size. 00652 // 00653 if ((lpCandList->dwCount > 1) && 00654 (lpCandList->dwSelection >= dwLength || 00655 lpCandList->dwPageStart >= dwLength || 00656 lpCandList->dwOffset[lpCandList->dwSelection] >= dwLength || 00657 lpCandList->dwOffset[lpCandList->dwPageStart] >= dwLength ) 00658 ) 00659 break; 00660 00661 dwLength = ConTbl->ScreenBufferSize.X; 00662 dwLength = (dwLength > 128) ? 128 : dwLength ; 00663 dwLength = ((dwLength < 12) ? 12 : dwLength ); 00664 00665 j = (dwLength-7)/(DELIMITERWIDTH+sizeof(WCHAR)); 00666 j = ((j > 9)?9:j); 00667 j = lpCandList->dwCount / j + 10; 00668 AllocLength = (j > DEFAULTCANDTABLE) ? j : DEFAULTCANDTABLE; 00669 00670 if (lpCandList->dwStyle == IME_CAND_CODE){ 00671 EnableCodePoint = TRUE; 00672 } 00673 else{ 00674 EnableCodePoint = FALSE; 00675 } 00676 00677 if (EnableCodePoint){ 00678 CountDispWidth = CODEDISPLEN; 00679 } 00680 else { 00681 for (CountDispWidth = 0 ,j = 1; j <= lpCandList->dwCount; CountDispWidth++) 00682 j *= 10; 00683 CountDispWidth *= 2; 00684 CountDispWidth++; 00685 } 00686 00687 if ((ConTbl->CandSepAllocSize != sizeof(DWORD)*AllocLength) && 00688 (ConTbl->CandSep != NULL)) { 00689 LocalFree(ConTbl->CandSep); 00690 ConTbl->CandSep = NULL; 00691 ConTbl->CandSepAllocSize = 0; 00692 } 00693 if (ConTbl->CandSep == NULL) { 00694 ConTbl->CandSep= LocalAlloc(LPTR, sizeof(DWORD)*AllocLength); 00695 if (ConTbl->CandSep == NULL) 00696 return FALSE; 00697 ConTbl->CandSepAllocSize = sizeof(DWORD)*AllocLength; 00698 } 00699 00700 if ( EnableCodePoint ){ 00701 j = 0; 00702 ConTbl->CandSep[j++] = 0; 00703 if (OpenFlag) { 00704 ConTbl->CandOff = lpCandList->dwSelection % 9; 00705 } 00706 i = ConTbl->CandOff; 00707 for (; i < lpCandList->dwCount; i+= 9 ) { 00708 ConTbl->CandSep[j++] = i; 00709 } 00710 if (i > lpCandList->dwCount) { 00711 i = lpCandList->dwCount; 00712 } 00713 } 00714 else{ 00715 j = 0; 00716 if (OpenFlag) { 00717 ConTbl->CandOff = 0; 00718 } 00719 ConTbl->CandSep[j++] = ConTbl->CandOff; 00720 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ 0 ]); 00721 dwDspLen = DispLenUnicode( lpStr ); 00722 width = dwDspLen + DELIMITERWIDTH; // '1:xxxx 2:xxxx ' 00723 for( i = 1; i < lpCandList->dwCount; i++ ) { 00724 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 00725 dwDspLen = DispLenUnicode( lpStr ); 00726 width += dwDspLen + DELIMITERWIDTH; 00727 if ((width > dwLength-CountDispWidth) || 00728 ( i - ConTbl->CandSep[j-1] >= 9)){ 00729 ConTbl->CandSep[j++] = i; 00730 width = dwDspLen + DELIMITERWIDTH; 00731 } 00732 } 00733 } 00734 ConTbl->CandSep[j] = i; 00735 ConTbl->CandMax = j; 00736 00737 SystemLineSize = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00738 if (ConTbl->SystemLineSize < SystemLineSize ){ 00739 if (ConTbl->SystemLine != NULL){ 00740 LocalFree( ConTbl->SystemLine ); 00741 ConTbl->SystemLine = NULL; 00742 ConTbl->SystemLineSize = 0; 00743 } 00744 ConTbl->SystemLine = (LPCONIME_CANDMESSAGE)LocalAlloc(LPTR, SystemLineSize ); 00745 if (ConTbl->SystemLine == NULL) { 00746 return FALSE; 00747 } 00748 ConTbl->SystemLineSize = SystemLineSize; 00749 } 00750 SystemLine = ConTbl->SystemLine; 00751 00752 SystemLine->AttrOff = sizeof(WCHAR) * dwLength + sizeof(DWORD); 00753 00754 CopyData.dwData = CI_CONIMECANDINFO; 00755 CopyData.cbData = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00756 CopyData.lpData = SystemLine; 00757 StartIndex = GetSystemLineJ( lpCandList, 00758 SystemLine->String, 00759 (LPSTR)SystemLine + SystemLine->AttrOff, 00760 dwLength, 00761 CountDispWidth, 00762 ConTbl, 00763 EnableCodePoint); 00764 00765 ConTbl->fNestCandidate = TRUE; // ImmNotyfyIME call back OpenCandidate Message 00766 // by same data. 00767 // so We ignore this mesage. 00768 ImmNotifyIME(hIMC, 00769 NI_SETCANDIDATE_PAGESTART, 00770 dwIndex, 00771 ConTbl->CandSep[StartIndex]); 00772 00773 ImmNotifyIME(hIMC, 00774 NI_SETCANDIDATE_PAGESIZE, 00775 dwIndex, 00776 ConTbl->CandSep[StartIndex+1] - 00777 ConTbl->CandSep[StartIndex]); 00778 ConTbl->fNestCandidate = FALSE; 00779 00780 ConsoleImeSendMessage( ConTbl->hWndCon, 00781 (WPARAM)hwnd, 00782 (LPARAM)&CopyData 00783 ); 00784 } 00785 } 00786 return TRUE; 00787 }

BOOL OpenCandidatePRC HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList,
BOOL  OpenFlag
 

Definition at line 433 of file country2.c.

References _CONIME_CANDMESSAGE::AttrOff, _CONSOLE_TABLE::CandListMemAllocSize, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandOff, _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::CandSepAllocSize, CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DEFAULTCANDTABLE, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::fNestCandidate, GetSystemLineP(), _CONSOLE_TABLE::hWndCon, ImmNotifyIME(), _CONSOLE_TABLE::lpCandListMem, MakeInfoStringPRC(), MAX_LISTCAND, NULL, PRCCOMPWIDTH, _CONSOLE_TABLE::ScreenBufferSize, _CONIME_CANDMESSAGE::String, _CONSOLE_TABLE::SystemLine, _CONSOLE_TABLE::SystemLineSize, and TRUE.

Referenced by ImeUIOpenCandidate().

00440 { 00441 DWORD dwLength; 00442 DWORD dwIndex; 00443 DWORD i; 00444 DWORD j; 00445 LPWSTR lpStr; 00446 DWORD dwDspLen; 00447 DWORD width; 00448 DWORD StartIndex; 00449 DWORD CountDispWidth; 00450 DWORD AllocLength; 00451 LPCANDIDATELIST lpCandList; 00452 LPCONIME_CANDMESSAGE SystemLine; 00453 DWORD SystemLineSize; 00454 COPYDATASTRUCT CopyData; 00455 LPCONIME_UIMODEINFO lpModeInfo; 00456 00457 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ); 00458 if ( lpModeInfo == NULL) { 00459 return FALSE; 00460 } 00461 00462 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 00463 if ( CandList & ( 1 << dwIndex ) ) { 00464 dwLength = ImmGetCandidateList(hIMC, dwIndex, NULL, 0); 00465 if (dwLength == 0) 00466 return FALSE; 00467 if ( (ConTbl->CandListMemAllocSize[dwIndex] != dwLength ) && 00468 (ConTbl->lpCandListMem[dwIndex] != NULL)) { 00469 LocalFree(ConTbl->lpCandListMem[dwIndex]); 00470 ConTbl->CandListMemAllocSize[dwIndex] = 0; 00471 ConTbl->lpCandListMem[dwIndex] = NULL; 00472 } 00473 if (ConTbl->lpCandListMem[dwIndex] == NULL) { 00474 ConTbl->lpCandListMem[dwIndex] = LocalAlloc(LPTR, dwLength); 00475 if (ConTbl->lpCandListMem[dwIndex] == NULL) 00476 return FALSE; 00477 ConTbl->CandListMemAllocSize[dwIndex] = dwLength; 00478 } 00479 lpCandList = ConTbl->lpCandListMem[dwIndex]; 00480 ImmGetCandidateList(hIMC, dwIndex, lpCandList, dwLength); 00481 00482 // 00483 // check each offset value is not over than buffer size. 00484 // 00485 if ((lpCandList->dwCount > 1) && 00486 (lpCandList->dwSelection >= dwLength || 00487 lpCandList->dwPageStart >= dwLength || 00488 lpCandList->dwOffset[lpCandList->dwSelection] >= dwLength || 00489 lpCandList->dwOffset[lpCandList->dwPageStart] >= dwLength ) 00490 ) 00491 break; 00492 00493 dwLength = ConTbl->ScreenBufferSize.X; 00494 dwLength = (dwLength > 128) ? 128 : dwLength ; 00495 dwLength = ((dwLength < 12) ? 12 : dwLength ); 00496 #if defined (CANDCOUNTPRC) //for wider candidate list space v-hirshi Oct.16.1996 00497 dwLength -= (20 + PRCCOMPWIDTH); //(8+1+4+1+PRCCOMPWIDTH+1+...+5) 00498 #else 00499 dwLength -= (15 + PRCCOMPWIDTH); //(8+1+4+1+PRCCOMPWIDTH+1+...) 00500 #endif 00501 00502 j = (dwLength-7)/(DELIMITERWIDTH+sizeof(WCHAR)); 00503 j = ((j > 9)?9:j); 00504 j = lpCandList->dwCount / j + 10; 00505 AllocLength = (j > DEFAULTCANDTABLE) ? j : DEFAULTCANDTABLE; 00506 00507 #if defined (CANDCOUNTPRC) //for wider candidate list space v-hirshi Oct.16.1996 00508 for (CountDispWidth = 0 ,j = 1; j <= lpCandList->dwCount; CountDispWidth++) 00509 j *= 10; 00510 CountDispWidth *= 2; 00511 CountDispWidth++; 00512 #else 00513 CountDispWidth = 0; 00514 #endif 00515 00516 if ((ConTbl->CandSepAllocSize != sizeof(DWORD)*AllocLength) && 00517 (ConTbl->CandSep != NULL)) { 00518 LocalFree(ConTbl->CandSep); 00519 ConTbl->CandSep = NULL; 00520 ConTbl->CandSepAllocSize = 0; 00521 } 00522 if (ConTbl->CandSep == NULL) { 00523 ConTbl->CandSep= LocalAlloc(LPTR, sizeof(DWORD)*AllocLength); 00524 if (ConTbl->CandSep == NULL) 00525 return FALSE; 00526 ConTbl->CandSepAllocSize = sizeof(DWORD)*AllocLength; 00527 } 00528 00529 j = 0; 00530 if (OpenFlag) { 00531 ConTbl->CandOff = 0; 00532 } 00533 ConTbl->CandSep[j++] = ConTbl->CandOff; 00534 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ 0 ]); 00535 dwDspLen = DispLenUnicode( lpStr ); 00536 width = dwDspLen + DELIMITERWIDTH; // '1:xxxx 2:xxxx ' 00537 for( i = 1; i < lpCandList->dwCount; i++ ) { 00538 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 00539 dwDspLen = DispLenUnicode( lpStr ); 00540 width += dwDspLen + DELIMITERWIDTH; 00541 if ((width > dwLength-CountDispWidth) || 00542 ( i - ConTbl->CandSep[j-1] >= 9)){ 00543 ConTbl->CandSep[j++] = i; 00544 width = dwDspLen + DELIMITERWIDTH; 00545 } 00546 } 00547 ConTbl->CandSep[j] = i; 00548 ConTbl->CandMax = j; 00549 00550 SystemLineSize = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00551 if (ConTbl->SystemLineSize < SystemLineSize ){ 00552 if (ConTbl->SystemLine != NULL){ 00553 LocalFree( ConTbl->SystemLine ); 00554 ConTbl->SystemLine = NULL; 00555 ConTbl->SystemLineSize = 0; 00556 } 00557 ConTbl->SystemLine = (LPCONIME_CANDMESSAGE)LocalAlloc(LPTR, SystemLineSize ); 00558 if (ConTbl->SystemLine == NULL) { 00559 return FALSE; 00560 } 00561 ConTbl->SystemLineSize = SystemLineSize; 00562 } 00563 SystemLine = ConTbl->SystemLine; 00564 00565 SystemLine->AttrOff = sizeof(WCHAR) * dwLength + sizeof(DWORD); 00566 00567 StartIndex = GetSystemLineP( lpCandList, 00568 SystemLine->String, 00569 (LPSTR)SystemLine + SystemLine->AttrOff, 00570 dwLength, 00571 CountDispWidth, 00572 ConTbl 00573 ); 00574 00575 ConTbl->fNestCandidate = TRUE; // ImmNotyfyIME call back OpenCandidate Message 00576 // by same data. 00577 // so We ignore this mesage. 00578 ImmNotifyIME(hIMC, 00579 NI_SETCANDIDATE_PAGESTART, 00580 dwIndex, 00581 ConTbl->CandSep[StartIndex]); 00582 00583 ImmNotifyIME(hIMC, 00584 NI_SETCANDIDATE_PAGESIZE, 00585 dwIndex, 00586 ConTbl->CandSep[StartIndex+1] - 00587 ConTbl->CandSep[StartIndex]); 00588 ConTbl->fNestCandidate = FALSE; 00589 00590 CopyData.dwData = CI_CONIMEMODEINFO; 00591 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00592 CopyData.lpData = lpModeInfo; 00593 if (MakeInfoStringPRC(ConTbl, lpModeInfo) ) { 00594 ConsoleImeSendMessage( ConTbl->hWndCon, 00595 (WPARAM)hwnd, 00596 (LPARAM)&CopyData 00597 ); 00598 } 00599 } 00600 } 00601 LocalFree( lpModeInfo ); 00602 return TRUE; 00603 }

BOOL OpenCandidateTaiwan HWND  hwnd,
HIMC  hIMC,
PCONSOLE_TABLE  ConTbl,
DWORD  CandList,
BOOL  OpenFlag
 

Definition at line 264 of file country2.c.

References _CONIME_CANDMESSAGE::AttrOff, _CONSOLE_TABLE::CandListMemAllocSize, _CONSOLE_TABLE::CandMax, _CONSOLE_TABLE::CandOff, _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::CandSepAllocSize, CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), DEFAULTCANDTABLE, DELIMITERWIDTH, DispLenUnicode(), DWORD, FALSE, _CONSOLE_TABLE::fNestCandidate, GetSystemLineT(), _CONSOLE_TABLE::hWndCon, IMECModeFullShapeLen, IMECNameLength, ImmNotifyIME(), _CONSOLE_TABLE::lpCandListMem, MakeInfoStringTaiwan(), MAX_LISTCAND, NULL, _CONSOLE_TABLE::ScreenBufferSize, _CONIME_CANDMESSAGE::String, _CONSOLE_TABLE::SystemLine, _CONSOLE_TABLE::SystemLineSize, and TRUE.

Referenced by ImeUIOpenCandidate().

00271 { 00272 DWORD dwLength; 00273 DWORD dwIndex; 00274 DWORD i; 00275 DWORD j; 00276 LPWSTR lpStr; 00277 DWORD dwDspLen; 00278 DWORD width; 00279 DWORD StartIndex; 00280 DWORD CountDispWidth; 00281 DWORD AllocLength; 00282 LPCANDIDATELIST lpCandList; 00283 LPCONIME_CANDMESSAGE SystemLine; 00284 DWORD SystemLineSize; 00285 COPYDATASTRUCT CopyData; 00286 LPCONIME_UIMODEINFO lpModeInfo; 00287 00288 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc( LPTR, sizeof(CONIME_UIMODEINFO) ); 00289 if ( lpModeInfo == NULL) { 00290 return FALSE; 00291 } 00292 00293 for (dwIndex = 0; dwIndex < MAX_LISTCAND ; dwIndex ++ ) { 00294 if ( CandList & ( 1 << dwIndex ) ) { 00295 dwLength = ImmGetCandidateList(hIMC, dwIndex, NULL, 0); 00296 if (dwLength == 0) 00297 return FALSE; 00298 if ( (ConTbl->CandListMemAllocSize[dwIndex] != dwLength ) && 00299 (ConTbl->lpCandListMem[dwIndex] != NULL)) { 00300 LocalFree(ConTbl->lpCandListMem[dwIndex]); 00301 ConTbl->CandListMemAllocSize[dwIndex] = 0; 00302 ConTbl->lpCandListMem[dwIndex] = NULL; 00303 } 00304 if (ConTbl->lpCandListMem[dwIndex] == NULL) { 00305 ConTbl->lpCandListMem[dwIndex] = LocalAlloc(LPTR, dwLength); 00306 if (ConTbl->lpCandListMem[dwIndex] == NULL) 00307 return FALSE; 00308 ConTbl->CandListMemAllocSize[dwIndex] = dwLength; 00309 } 00310 lpCandList = ConTbl->lpCandListMem[dwIndex]; 00311 ImmGetCandidateList(hIMC, dwIndex, lpCandList, dwLength); 00312 00313 // 00314 // check each offset value is not over than buffer size. 00315 // 00316 if ((lpCandList->dwCount > 1) && 00317 (lpCandList->dwSelection >= dwLength || 00318 lpCandList->dwPageStart >= dwLength || 00319 lpCandList->dwOffset[lpCandList->dwSelection] >= dwLength || 00320 lpCandList->dwOffset[lpCandList->dwPageStart] >= dwLength ) 00321 ) 00322 break; 00323 00324 dwLength = ConTbl->ScreenBufferSize.X; 00325 dwLength = (dwLength > 128) ? 128 : dwLength ; 00326 dwLength = ((dwLength < 12) ? 12 : dwLength ); 00327 #if defined (CANDCOUNTCHT) //for wider candidate list space v-hirshi Oct.16.1996 00328 dwLength -= 28; // 6+1+4+1+10+1+....+4+1 00329 #else 00330 dwLength -= IMECNameLength+1+IMECModeFullShapeLen*2+1; // 4+1+2+1+.... 00331 #endif 00332 00333 j = (dwLength-7)/(DELIMITERWIDTH+sizeof(WCHAR)); 00334 j = ((j > 9)?9:j); 00335 j = lpCandList->dwCount / j + 10; 00336 AllocLength = (j > DEFAULTCANDTABLE) ? j : DEFAULTCANDTABLE; 00337 00338 for (CountDispWidth = 0 ,j = 1; j <= lpCandList->dwCount; CountDispWidth++) 00339 j *= 10; 00340 CountDispWidth *= 2; 00341 CountDispWidth++; 00342 00343 if ((ConTbl->CandSepAllocSize != sizeof(DWORD)*AllocLength) && 00344 (ConTbl->CandSep != NULL)) { 00345 LocalFree(ConTbl->CandSep); 00346 ConTbl->CandSep = NULL; 00347 ConTbl->CandSepAllocSize = 0; 00348 } 00349 if (ConTbl->CandSep == NULL) { 00350 ConTbl->CandSep= LocalAlloc(LPTR, sizeof(DWORD)*AllocLength); 00351 if (ConTbl->CandSep == NULL) 00352 return FALSE; 00353 ConTbl->CandSepAllocSize = sizeof(DWORD)*AllocLength; 00354 } 00355 00356 j = 0; 00357 if (OpenFlag) { 00358 ConTbl->CandOff = 0; 00359 } 00360 ConTbl->CandSep[j++] = ConTbl->CandOff; 00361 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ 0 ]); 00362 dwDspLen = DispLenUnicode( lpStr ); 00363 width = dwDspLen + DELIMITERWIDTH; // '1:xxxx 2:xxxx ' 00364 for( i = 1; i < lpCandList->dwCount; i++ ) { 00365 lpStr = (LPWSTR)((LPSTR)lpCandList + lpCandList->dwOffset[ i ]); 00366 dwDspLen = DispLenUnicode( lpStr ); 00367 width += dwDspLen + DELIMITERWIDTH; 00368 if ((width > dwLength-CountDispWidth) || 00369 ( i - ConTbl->CandSep[j-1] >= 9)){ 00370 ConTbl->CandSep[j++] = i; 00371 width = dwDspLen + DELIMITERWIDTH; 00372 } 00373 } 00374 ConTbl->CandSep[j] = i; 00375 ConTbl->CandMax = j; 00376 00377 SystemLineSize = (sizeof(WCHAR)+sizeof(UCHAR))*dwLength + sizeof(DWORD); 00378 if (ConTbl->SystemLineSize < SystemLineSize ){ 00379 if (ConTbl->SystemLine != NULL){ 00380 LocalFree( ConTbl->SystemLine ); 00381 ConTbl->SystemLine = NULL; 00382 ConTbl->SystemLineSize = 0; 00383 } 00384 ConTbl->SystemLine = (LPCONIME_CANDMESSAGE)LocalAlloc(LPTR, SystemLineSize ); 00385 if (ConTbl->SystemLine == NULL) { 00386 return FALSE; 00387 } 00388 ConTbl->SystemLineSize = SystemLineSize; 00389 } 00390 SystemLine = ConTbl->SystemLine; 00391 00392 SystemLine->AttrOff = sizeof(WCHAR) * dwLength + sizeof(DWORD); 00393 00394 StartIndex = GetSystemLineT( lpCandList, 00395 SystemLine->String, 00396 (LPSTR)SystemLine + SystemLine->AttrOff, 00397 dwLength, 00398 CountDispWidth, 00399 ConTbl 00400 ); 00401 00402 ConTbl->fNestCandidate = TRUE; // ImmNotyfyIME call back OpenCandidate Message 00403 // by same data. 00404 // so We ignore this mesage. 00405 ImmNotifyIME(hIMC, 00406 NI_SETCANDIDATE_PAGESTART, 00407 dwIndex, 00408 ConTbl->CandSep[StartIndex]); 00409 00410 ImmNotifyIME(hIMC, 00411 NI_SETCANDIDATE_PAGESIZE, 00412 dwIndex, 00413 ConTbl->CandSep[StartIndex+1] - 00414 ConTbl->CandSep[StartIndex]); 00415 ConTbl->fNestCandidate = FALSE; 00416 00417 CopyData.dwData = CI_CONIMEMODEINFO; 00418 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 00419 CopyData.lpData = lpModeInfo; 00420 if (MakeInfoStringTaiwan(ConTbl, lpModeInfo) ) { 00421 ConsoleImeSendMessage( ConTbl->hWndCon, 00422 (WPARAM)hwnd, 00423 (LPARAM)&CopyData 00424 ); 00425 } 00426 } 00427 } 00428 LocalFree( lpModeInfo ); 00429 return TRUE; 00430 }

VOID ReDisplayCompositionStr HWND  hwnd  ) 
 

Definition at line 928 of file country3.c.

References DBGPRINT, _CONSOLE_TABLE::fInComposition, HKL_TO_LANGID, _CONSOLE_TABLE::hklActive, LANG_ID_JAPAN, LANG_ID_KOREA, LANG_ID_PRC, LANG_ID_TAIWAN, LastConsole, NULL, ReDisplayCompStrJapan(), ReDisplayCompStrKorea(), ReDisplayCompStrPRC(), ReDisplayCompStrTaiwan(), and SearchConsole().

Referenced by ConsoleSetFocus().

00931 { 00932 PCONSOLE_TABLE ConTbl; 00933 00934 ConTbl = SearchConsole(LastConsole); 00935 if (ConTbl == NULL) { 00936 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00937 return; 00938 } 00939 00940 if (! ConTbl->fInComposition) 00941 return; 00942 00943 switch ( HKL_TO_LANGID(ConTbl->hklActive)) 00944 { 00945 case LANG_ID_JAPAN: 00946 ReDisplayCompStrJapan(hwnd, ConTbl); 00947 break; 00948 case LANG_ID_TAIWAN: 00949 ReDisplayCompStrTaiwan(hwnd, ConTbl); 00950 break; 00951 case LANG_ID_PRC: 00952 ReDisplayCompStrPRC(hwnd, ConTbl); 00953 break; 00954 case LANG_ID_KOREA: 00955 ReDisplayCompStrKorea(hwnd, ConTbl); 00956 break; 00957 default: 00958 break; 00959 } 00960 return; 00961 }

VOID ReDisplayCompStrJapan HWND  hwnd,
PCONSOLE_TABLE  ConTbl
 

Definition at line 964 of file country3.c.

References CI_CONIMECOMPOSITION, ConsoleImeSendMessage(), _CONIME_UICOMPMESSAGE::dwSize, _CONSOLE_TABLE::hWndCon, and _CONSOLE_TABLE::lpCompStrMem.

Referenced by ReDisplayCompositionStr().

00968 { 00969 COPYDATASTRUCT CopyData; 00970 LPCONIME_UICOMPMESSAGE lpCompStrMem; 00971 00972 lpCompStrMem = ConTbl->lpCompStrMem; 00973 CopyData.dwData = CI_CONIMECOMPOSITION; 00974 CopyData.cbData = lpCompStrMem->dwSize; 00975 CopyData.lpData = lpCompStrMem; 00976 ConsoleImeSendMessage( ConTbl->hWndCon, 00977 (WPARAM)hwnd, 00978 (LPARAM)&CopyData 00979 ); 00980 }

VOID ReDisplayCompStrKorea HWND  hwnd,
PCONSOLE_TABLE  ConTbl
 

Definition at line 1042 of file country3.c.

References CI_CONIMECOMPOSITION, ConsoleImeSendMessage(), _CONIME_UICOMPMESSAGE::dwSize, _CONSOLE_TABLE::hWndCon, and _CONSOLE_TABLE::lpCompStrMem.

Referenced by ReDisplayCompositionStr().

01046 { 01047 01048 COPYDATASTRUCT CopyData; 01049 LPCONIME_UICOMPMESSAGE lpCompStrMem; 01050 01051 lpCompStrMem = ConTbl->lpCompStrMem; 01052 CopyData.dwData = CI_CONIMECOMPOSITION; 01053 CopyData.cbData = lpCompStrMem->dwSize; 01054 CopyData.lpData = lpCompStrMem; 01055 ConsoleImeSendMessage( ConTbl->hWndCon, 01056 (WPARAM)hwnd, 01057 (LPARAM)&CopyData 01058 ); 01059 01060 }

VOID ReDisplayCompStrPRC HWND  hwnd,
PCONSOLE_TABLE  ConTbl
 

Definition at line 1013 of file country3.c.

References CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), _CONSOLE_TABLE::hWndCon, MakeInfoStringPRC(), and NULL.

Referenced by ReDisplayCompositionStr().

01017 { 01018 COPYDATASTRUCT CopyData; 01019 LPCONIME_UIMODEINFO lpModeInfo; 01020 01021 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ); 01022 if ( lpModeInfo == NULL) { 01023 return; 01024 } 01025 // 01026 // Display character to Console 01027 // 01028 CopyData.dwData = CI_CONIMEMODEINFO; 01029 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 01030 CopyData.lpData = lpModeInfo; 01031 01032 if (MakeInfoStringPRC(ConTbl, lpModeInfo) ) { 01033 ConsoleImeSendMessage( ConTbl->hWndCon, 01034 (WPARAM)hwnd, 01035 (LPARAM)&CopyData 01036 ); 01037 } 01038 LocalFree( lpModeInfo ); 01039 }

VOID ReDisplayCompStrTaiwan HWND  hwnd,
PCONSOLE_TABLE  ConTbl
 

Definition at line 983 of file country3.c.

References CI_CONIMEMODEINFO, CONIME_UIMODEINFO, ConsoleImeSendMessage(), _CONSOLE_TABLE::hWndCon, MakeInfoStringTaiwan(), and NULL.

Referenced by ReDisplayCompositionStr().

00987 { 00988 COPYDATASTRUCT CopyData; 00989 LPCONIME_UIMODEINFO lpModeInfo; 00990 00991 lpModeInfo = (LPCONIME_UIMODEINFO)LocalAlloc(LPTR, sizeof(CONIME_UIMODEINFO) ); 00992 if ( lpModeInfo == NULL) { 00993 return; 00994 } 00995 // 00996 // Display character to Console 00997 // 00998 CopyData.dwData = CI_CONIMEMODEINFO; 00999 CopyData.cbData = sizeof(CONIME_UIMODEINFO); 01000 CopyData.lpData = lpModeInfo; 01001 01002 if (MakeInfoStringTaiwan(ConTbl, lpModeInfo) ) { 01003 ConsoleImeSendMessage( ConTbl->hWndCon, 01004 (WPARAM)hwnd, 01005 (LPARAM)&CopyData 01006 ); 01007 } 01008 01009 LocalFree( lpModeInfo ); 01010 }

BOOL RemoveConsole HWND  hwnd,
HANDLE  hConsole
 

Definition at line 801 of file ntcon/conime/conime.c.

References BOOL, FALSE, LockConsoleTable, NULL, RemoveConsoleWorker(), SearchConsole(), and UnlockConsoleTable.

00805 { 00806 PCONSOLE_TABLE ConTbl; 00807 BOOL ret; 00808 00809 LockConsoleTable(); 00810 00811 ConTbl = SearchConsole(hConsole); 00812 if (ConTbl == NULL) 00813 { 00814 UnlockConsoleTable(); 00815 return FALSE; 00816 } 00817 ret = RemoveConsoleWorker(hwnd, ConTbl); 00818 00819 UnlockConsoleTable(); 00820 return ret; 00821 }

BOOL RemoveConsoleWorker HWND  hwnd,
PCONSOLE_TABLE  ConTbl
 

Definition at line 824 of file ntcon/conime/conime.c.

References _CONSOLE_TABLE::CandSep, _CONSOLE_TABLE::ConsoleCP, _CONSOLE_TABLE::ConsoleOutputCP, DWORD, _CONSOLE_TABLE::Enable, FALSE, _CONSOLE_TABLE::hConsole, _CONSOLE_TABLE::hIMC_Original, _CONSOLE_TABLE::hklActive, ImmDestroyContext(), _CONSOLE_TABLE::LateRemove, _CONSOLE_TABLE::lpCandListMem, _CONSOLE_TABLE::lpCompStrMem, _CONSOLE_TABLE::lphklList, MAX_LISTCAND, NULL, _CONSOLE_TABLE::ScreenBufferSize, and TRUE.

Referenced by InsertConsole(), and RemoveConsole().

00828 { 00829 DWORD j; 00830 00831 if (ConTbl->Enable) { 00832 ConTbl->hConsole = NULL; 00833 ConTbl->ScreenBufferSize.X = 0; 00834 ConTbl->ConsoleCP = 0; 00835 ConTbl->ConsoleOutputCP = 0; 00836 ConTbl->hklActive = 0; 00837 00838 ImmDestroyContext(ConTbl->hIMC_Original); 00839 00840 if (ConTbl->lpCompStrMem != NULL){ 00841 LocalFree(ConTbl->lpCompStrMem); 00842 } 00843 for (j = 0; j < MAX_LISTCAND; j++){ 00844 if (ConTbl->lpCandListMem[j] != NULL) { 00845 LocalFree(ConTbl->lpCandListMem[j]); 00846 } 00847 } 00848 if (ConTbl->CandSep != NULL) { 00849 LocalFree(ConTbl->CandSep); 00850 } 00851 00852 if (ConTbl->lphklList != NULL) { 00853 LocalFree(ConTbl->lphklList) ; 00854 } 00855 00856 ConTbl->Enable = FALSE; 00857 ConTbl->LateRemove = FALSE; 00858 } 00859 else 00860 ConTbl->LateRemove = TRUE; 00861 00862 #ifdef DEBUG_MODE 00863 InvalidateRect(hwnd,NULL,TRUE); 00864 #endif 00865 return TRUE; 00866 }

PCONSOLE_TABLE SearchConsole HANDLE  hConsole  ) 
 

Definition at line 767 of file ntcon/conime/conime.c.

References ConsoleTable, _CONSOLE_TABLE::hConsole, LastConsole, _CONSOLE_TABLE::LateRemove, LockConsoleTable, NULL, NumberOfConsoleTable, and UnlockConsoleTable.

Referenced by CharHandlerToConsole(), ConImeInputLangchange(), ConImeInputLangchangeRequest(), ConsoleCodepageChange(), ConsoleKillFocus(), ConsoleScreenBufferSize(), ConsoleSetFocus(), GetCompositionStr(), GetNLSMode(), ImeSysPropertyWindow(), ImeUICloseCandidate(), ImeUIEndComposition(), ImeUIGuideLine(), ImeUIOpenCandidate(), ImeUIOpenStatusWindow(), ImeUISetConversionMode(), ImeUISetOpenStatus(), ImeUIStartComposition(), InputLangchange(), InsertNewConsole(), ReDisplayCompositionStr(), RemoveConsole(), SetNLSMode(), and WndProc().

00770 { 00771 ULONG i; 00772 PCONSOLE_TABLE FocusedConsole; 00773 00774 LockConsoleTable(); 00775 00776 // conime receive ime message from console before 1st console registered. 00777 // this will happen after restart conime when conime dead by bogus ime's AV or 00778 // other problem 00779 // so this fail safe code is necessary to protect consrv. 00780 if (LastConsole == 0) { 00781 LastConsole = hConsole ; 00782 } 00783 00784 for (i = 1; i < NumberOfConsoleTable; i++) { 00785 FocusedConsole = ConsoleTable[i]; 00786 if (FocusedConsole != NULL) 00787 { 00788 if ((FocusedConsole->hConsole == hConsole)&& 00789 (!FocusedConsole->LateRemove)) { 00790 00791 UnlockConsoleTable(); 00792 return FocusedConsole; 00793 } 00794 } 00795 } 00796 UnlockConsoleTable(); 00797 return NULL; 00798 }

BOOL SetNLSMode HWND  hWnd,
HANDLE  hConsole,
DWORD  fdwConversion
 

Definition at line 670 of file consubs.c.

References DBGPRINT, _CONSOLE_TABLE::dwConversion, _CONSOLE_TABLE::dwSentence, FALSE, _CONSOLE_TABLE::fOpen, _CONSOLE_TABLE::hIMC_Current, _CONSOLE_TABLE::hIMC_Original, hWnd, IME_CMODE_DISABLE, IME_CMODE_OPEN, ImmAssociateContext(), ImmGetContext(), ImmReleaseContext(), ImmSetActiveContextConsoleIME(), ImmSetConversionStatus(), ImmSetOpenStatus(), NULL, SearchConsole(), and TRUE.

Referenced by ConImeInputLangchange(), and WndProc().

00675 { 00676 PCONSOLE_TABLE ConTbl; 00677 HIMC hIMC; 00678 00679 ConTbl = SearchConsole(hConsole); 00680 if (ConTbl == NULL) { 00681 DBGPRINT(("CONIME: Error! Cannot found registed Console\n")); 00682 return FALSE; 00683 } 00684 00685 if (fdwConversion & IME_CMODE_DISABLE) 00686 { 00687 ImmSetActiveContextConsoleIME(hWnd, FALSE) ; 00688 ImmAssociateContext(hWnd, (HIMC)NULL); 00689 ConTbl->hIMC_Current = (HIMC)NULL; 00690 } 00691 else 00692 { 00693 ImmAssociateContext(hWnd, ConTbl->hIMC_Original); 00694 ImmSetActiveContextConsoleIME(hWnd, TRUE) ; 00695 ConTbl->hIMC_Current = ConTbl->hIMC_Original; 00696 } 00697 00698 hIMC = ImmGetContext( hWnd ) ; 00699 if ( hIMC == (HIMC)NULL ) 00700 return TRUE; 00701 00702 ConTbl->fOpen =(fdwConversion & IME_CMODE_OPEN) ? TRUE : FALSE ; 00703 ImmSetOpenStatus(hIMC, ConTbl->fOpen); 00704 00705 fdwConversion &= ~(IME_CMODE_DISABLE | IME_CMODE_OPEN); 00706 if (ConTbl->dwConversion != fdwConversion) 00707 { 00708 ConTbl->dwConversion = fdwConversion; 00709 ImmSetConversionStatus(hIMC, 00710 ConTbl->dwConversion, 00711 ConTbl->dwSentence ); 00712 } 00713 00714 ImmReleaseContext( hWnd, hIMC ); 00715 00716 return TRUE; 00717 }

VOID VirtualKeyHandler HWND  hWnd,
UINT  wParam,
UINT  lParam
 

Referenced by CharHandlerToConsole().

LRESULT FAR PASCAL WndProc HWND  hWnd,
UINT  Message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 288 of file ntcon/conime/conime.c.

References BeginPaint, BOOL, CharHandlerFromConsole(), CharHandlerToConsole(), CONIME_BACKWARD, CONIME_CREATE, CONIME_DESTROY, CONIME_DIRECT, CONIME_FORWARD, CONIME_GET_NLSMODE, CONIME_HOTKEY, CONIME_INPUTLANGCHANGE, CONIME_INPUTLANGCHANGEREQUEST, CONIME_INPUTLANGCHANGEREQUESTBACKWARD, CONIME_INPUTLANGCHANGEREQUESTFORWARD, CONIME_KEYDATA, CONIME_KILLFOCUS, CONIME_NOTIFY_CODEPAGE, CONIME_NOTIFY_SCREENBUFFERSIZE, CONIME_NOTIFY_VK_KANA, CONIME_SET_NLSMODE, CONIME_SETFOCUS, ConimeHotkey(), ConImeInputLangchange(), ConImeInputLangchangeRequest(), ConsoleCodepageChange(), ConsoleKillFocus(), ConsoleScreenBufferSize(), ConsoleSetFocus(), ConsoleTable, Create(), CreateCaret, DBGPRINT, DefWindowProc(), DestroyCaret(), DestroyWindow, dwConsoleThreadId, DWORD, _CONSOLE_TABLE::Enable, EnableWindow(), ExitList(), FALSE, FAR, GetNLSMode(), gfDoNotKillFocus, _CONSOLE_TABLE::hConsole, hWnd, _CONSOLE_TABLE::hWndCon, ImeSysPropertyWindow(), ImeUIComposition(), ImeUIEndComposition(), ImeUINotify(), ImeUISetConversionMode(), ImeUIStartComposition(), InputExceptionFilter, InputLangchange(), InsertNewConsole(), IsUnicodeFullWidth(), IsWindowEnabled(), L, LastConsole, _CONSOLE_TABLE::LateRemove, LockConsoleTable, MM_ACCESS_VIOLATION, MM_EXIT, NULL, NumberOfConsoleTable, PBYTE, PostMessage(), PostQuitMessage(), RemoveConsole(), SearchConsole(), SetCaretPos(), SetForegroundWindow(), SetNLSMode(), TRUE, UINT, and UnlockConsoleTable.

00292 { 00293 DWORD dwImmRet = 0; // return value of ImmSrvProcessKey() 00294 00295 try { 00296 00297 switch (Message) 00298 { 00299 case CONIME_CREATE: 00300 DBGPRINT(("CONIME: CONIME_CREATE: Console Handle=%08x\n", wParam)); 00301 return InsertNewConsole(hWnd,(HANDLE)wParam,(HWND)lParam); 00302 00303 case CONIME_DESTROY: 00304 DBGPRINT(("CONIME: CONIME_DESTROY: Console Handle=%08x\n", wParam)); 00305 return RemoveConsole(hWnd, (HANDLE)wParam); 00306 00307 case CONIME_SETFOCUS: 00308 DBGPRINT(("CONIME: CONIME_SETFOCUS: Console Handle=%08x\n", wParam)); 00309 return ConsoleSetFocus(hWnd, (HANDLE)wParam, (HKL)lParam); 00310 00311 case CONIME_KILLFOCUS: 00312 DBGPRINT(("CONIME: CONIME_KILLFOCUS: Console Handle=%08x\n", wParam)); 00313 return ConsoleKillFocus(hWnd, (HANDLE)wParam); 00314 00315 case CONIME_GET_NLSMODE: 00316 DBGPRINT(("CONIME: CONIME_GET_NLSMODE: Console Handle=%08x\n", wParam)); 00317 return GetNLSMode(hWnd, (HANDLE)wParam); 00318 00319 case CONIME_SET_NLSMODE: 00320 DBGPRINT(("CONIME: CONIME_SET_NLSMODE: Console Handle=%08x\n", wParam)); 00321 return SetNLSMode(hWnd, (HANDLE)wParam, (DWORD)lParam); 00322 00323 case CONIME_HOTKEY: 00324 DBGPRINT(("CONIME: CONIME_HOTKEY\n")); 00325 return ConimeHotkey(hWnd, (HANDLE)wParam, (DWORD)lParam); 00326 00327 case CONIME_NOTIFY_VK_KANA: 00328 DBGPRINT(("CONIME: CONIME_NOTIFY_VK_KANA\n")); 00329 return ImeUISetConversionMode(hWnd); 00330 00331 case CONIME_NOTIFY_SCREENBUFFERSIZE: { 00332 COORD ScreenBufferSize; 00333 DBGPRINT(("CONIME: CONIME_NOTIFY_SCREENBUFFERSIZE: Console Handle=%08x\n", wParam)); 00334 ScreenBufferSize.X = LOWORD(lParam); 00335 ScreenBufferSize.Y = HIWORD(lParam); 00336 return ConsoleScreenBufferSize(hWnd, (HANDLE)wParam, ScreenBufferSize); 00337 } 00338 00339 case CONIME_INPUTLANGCHANGE: { 00340 DBGPRINT(("CONIME: CONIME_INPUTLANGCHANGE: Console Handle=%08x \n",wParam)); 00341 ConImeInputLangchange(hWnd, (HANDLE)wParam, (HKL)lParam ); 00342 return TRUE; 00343 } 00344 00345 case CONIME_NOTIFY_CODEPAGE: { 00346 BOOL Output; 00347 WORD Codepage; 00348 00349 Codepage = HIWORD(lParam); 00350 Output = LOWORD(lParam); 00351 DBGPRINT(("CONIME: CONIME_NOTIFY_CODEPAGE: Console Handle=%08x %04x %04x\n",wParam, Output, Codepage)); 00352 return ConsoleCodepageChange(hWnd, (HANDLE)wParam, Output, Codepage); 00353 } 00354 00355 case WM_KEYDOWN +CONIME_KEYDATA: 00356 case WM_KEYUP +CONIME_KEYDATA: 00357 case WM_SYSKEYDOWN +CONIME_KEYDATA: 00358 case WM_SYSKEYUP +CONIME_KEYDATA: 00359 case WM_DEADCHAR +CONIME_KEYDATA: 00360 case WM_SYSDEADCHAR+CONIME_KEYDATA: 00361 case WM_SYSCHAR +CONIME_KEYDATA: 00362 case WM_CHAR +CONIME_KEYDATA: 00363 CharHandlerFromConsole( hWnd, Message, (ULONG)wParam, (ULONG)lParam ); 00364 break; 00365 case WM_KEYDOWN: 00366 case WM_KEYUP: 00367 case WM_SYSKEYDOWN: 00368 case WM_SYSKEYUP: 00369 case WM_DEADCHAR: 00370 case WM_SYSDEADCHAR: 00371 case WM_SYSCHAR: 00372 case WM_CHAR: 00373 CharHandlerToConsole( hWnd, Message, (ULONG)wParam, (ULONG)lParam ); 00374 break; 00375 00376 case WM_INPUTLANGCHANGE: 00377 DBGPRINT(("CONIME: CONIME_INPUTLANGCHANGE: Console Handle=%08x \n",wParam)); 00378 InputLangchange(hWnd, (DWORD)wParam, (HKL)lParam ); 00379 return TRUE; 00380 00381 case WM_INPUTLANGCHANGEREQUEST: 00382 // Console IME never receive this message for this window is hidden 00383 // and doesn't have focus. 00384 // 00385 // However, Hot key of IME_CHOTKEY_IME_NONIME_TOGGLE/IME_THOTKEY_IME_NONIME_TOGGLE 00386 // are send this message by ImmSimulateHotKey API. 00387 // 00388 // If nothing processing by this message, then DefWindowProc calls 00389 // ActivateKeyboardLayout on kernel side. 00390 // And, ActivateKeyboardLayout send WM_INPUTLANGCHANGE message to focus window 00391 // on this message queue. 00392 // It window is console window procedure. 00393 // Console window procedure can do send CONIME_INPUTLANGCHANGE message to 00394 // console IME window. 00395 // In console window is windowed case, this sequence as well. 00396 // But, In console window is full screen case, message queue have not focus. 00397 // WM_INPUTLANGCHANGE message can not send to console window procedure. 00398 // 00399 // This code avoid console full screen mode problem. 00400 // Send message to console window procedure when this window receive it. 00401 // 00402 { 00403 PCONSOLE_TABLE ConTbl; 00404 00405 ConTbl = SearchConsole(LastConsole); 00406 if (ConTbl == NULL) { 00407 return DefWindowProc(hWnd, Message, wParam, lParam); 00408 } 00409 00410 PostMessage(ConTbl->hWndCon, Message, wParam, lParam); 00411 } 00412 return TRUE; // TRUE : process this message by application 00413 00414 case CONIME_INPUTLANGCHANGEREQUEST: 00415 DBGPRINT(("CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam)); 00416 return ConImeInputLangchangeRequest(hWnd, (HANDLE)wParam, (HKL)lParam, CONIME_DIRECT); 00417 00418 case CONIME_INPUTLANGCHANGEREQUESTFORWARD: 00419 DBGPRINT(("CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam)); 00420 return ConImeInputLangchangeRequest(hWnd, (HANDLE)wParam, (HKL)lParam, CONIME_FORWARD); 00421 00422 case CONIME_INPUTLANGCHANGEREQUESTBACKWARD: 00423 DBGPRINT(("CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam)); 00424 return ConImeInputLangchangeRequest(hWnd, (HANDLE)wParam, (HKL)lParam, CONIME_BACKWARD); 00425 00426 #ifdef DEBUG_MODE 00427 case WM_MOVE: 00428 ImeUIMoveCandWin( hWnd ); 00429 break; 00430 00431 case WM_COMMAND: // message: command from application menu 00432 00433 // Message packing of wparam and lparam have changed for Win32, 00434 // so use the GET_WM_COMMAND macro to unpack the commnad 00435 00436 switch (LOWORD(wParam)) { 00437 case MM_EXIT: 00438 PostMessage(hWnd,WM_CLOSE,0,0L); 00439 break; 00440 00441 case MM_ACCESS_VIOLATION: 00442 { 00443 PBYTE p = 0; 00444 *p = 0; 00445 } 00446 break; 00447 } 00448 break; 00449 #endif 00450 00451 case WM_IME_STARTCOMPOSITION: 00452 ImeUIStartComposition( hWnd ); 00453 break; 00454 case WM_IME_ENDCOMPOSITION: 00455 ImeUIEndComposition( hWnd ); 00456 break; 00457 case WM_IME_COMPOSITION: 00458 ImeUIComposition( hWnd, wParam, lParam ); 00459 break; 00460 case WM_IME_COMPOSITIONFULL: 00461 break; 00462 case WM_IME_NOTIFY: 00463 if ( !ImeUINotify( hWnd, wParam, lParam ) ) { 00464 return DefWindowProc(hWnd, Message, wParam, lParam); 00465 } 00466 break; 00467 case WM_IME_SETCONTEXT: 00468 // 00469 // The application have to pass WM_IME_SETCONTEXT to DefWindowProc. 00470 // When the application want to handle the IME at the timing of 00471 // focus changing, the application should use WM_GETFOCUS or 00472 // WM_KILLFOCUS. 00473 // 00474 lParam &= ~ISC_SHOWUIALL; 00475 00476 return DefWindowProc( hWnd, Message, wParam, lParam ); 00477 case WM_IME_SYSTEM: 00478 switch (wParam) { 00479 case IMS_CLOSEPROPERTYWINDOW: 00480 case IMS_OPENPROPERTYWINDOW: 00481 ImeSysPropertyWindow(hWnd, wParam, lParam); 00482 break; 00483 default: 00484 return DefWindowProc( hWnd, Message, wParam, lParam ); 00485 } 00486 break; 00487 00488 case WM_CREATE: 00489 return Create(hWnd); 00490 break; 00491 00492 case WM_DESTROY: 00493 DBGPRINT(("CONIME:Recieve WM_DESTROY\n")); 00494 ExitList(hWnd); 00495 PostQuitMessage(0); 00496 return 0; 00497 break; 00498 00499 case WM_CLOSE: 00500 DBGPRINT(("CONIME:Recieve WM_CLOSE\n")); 00501 DestroyWindow(hWnd); 00502 return 0; 00503 break; 00504 00505 case WM_ENABLE:{ 00506 PCONSOLE_TABLE FocusedConsole; 00507 if (!wParam) { 00508 FocusedConsole = SearchConsole(LastConsole); 00509 if (FocusedConsole != NULL && 00510 FocusedConsole->hConsole != NULL) { 00511 FocusedConsole->Enable = FALSE; 00512 EnableWindow(FocusedConsole->hWndCon,FALSE); 00513 gfDoNotKillFocus = TRUE; 00514 } 00515 } 00516 else{ 00517 DWORD i; 00518 LockConsoleTable(); 00519 for ( i = 1; i < NumberOfConsoleTable; i ++){ 00520 FocusedConsole = ConsoleTable[i]; 00521 if (FocusedConsole != NULL) 00522 { 00523 if ((FocusedConsole->hConsole != NULL)&& 00524 (!FocusedConsole->Enable)&& 00525 (!IsWindowEnabled(FocusedConsole->hWndCon))){ 00526 EnableWindow(FocusedConsole->hWndCon,TRUE); 00527 FocusedConsole->Enable = TRUE; 00528 if (!FocusedConsole->LateRemove) 00529 SetForegroundWindow(FocusedConsole->hWndCon); 00530 } 00531 } 00532 } 00533 UnlockConsoleTable(); 00534 } 00535 return DefWindowProc(hWnd, Message, wParam, lParam); 00536 break; 00537 } 00538 00539 #ifdef DEBUG_MODE 00540 case WM_SETFOCUS: 00541 CreateCaret( hWnd, 00542 NULL, 00543 IsUnicodeFullWidth( ConvertLine[xPos] ) ? 00544 CaretWidth*2 : CaretWidth, 00545 (UINT)cyMetrics ); 00546 SetCaretPos( xPos * cxMetrics, 0 ); 00547 ShowCaret( hWnd ); 00548 break; 00549 00550 case WM_KILLFOCUS: 00551 HideCaret( hWnd ); 00552 DestroyCaret(); 00553 break; 00554 00555 case WM_PAINT: 00556 { 00557 PAINTSTRUCT pstruc; 00558 HDC hDC; 00559 hDC = BeginPaint(hWnd,&pstruc); 00560 ReDraw(hWnd); 00561 EndPaint(hWnd,&pstruc); 00562 break; 00563 } 00564 #endif 00565 00566 case WM_QUERYENDSESSION: 00567 #ifdef HIRSHI_DEBUG 00568 /* 00569 * If specified ntsd debugger on this process, 00570 * then never catch WM_QUERYENDSESSION when logoff/shutdown because 00571 * this process will terminate when ntsd process terminated. 00572 */ 00573 { 00574 int i; 00575 i = MessageBox(hWnd,TEXT("Could you approve exit session?"), TEXT("Console IME"), 00576 MB_ICONSTOP | MB_YESNO); 00577 return (i == IDYES ? TRUE : FALSE); 00578 } 00579 #endif 00580 return TRUE; // Logoff or shutdown time. 00581 00582 case WM_ENDSESSION: 00583 DBGPRINT(("CONIME:Recieve WM_ENDSESSION\n")); 00584 ExitList(hWnd); 00585 return 0; 00586 00587 default: // Passes it on if unproccessed 00588 return DefWindowProc(hWnd, Message, wParam, lParam); 00589 } 00590 00591 } except (InputExceptionFilter(GetExceptionInformation())) { 00592 00593 if (dwConsoleThreadId) 00594 { 00595 DBGPRINT(("CONIME: Exception on WndProc!!\n")); 00596 UnregisterConsoleIME(); 00597 dwConsoleThreadId = 0; 00598 00599 DestroyWindow(hWnd); 00600 return 0; 00601 } 00602 00603 } 00604 00605 00606 return TRUE; 00607 }


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