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

eckanji.c

Go to the documentation of this file.
00001 /****************************************************************************/ 00002 /* */ 00003 /* ECKANJI.C - */ 00004 /* */ 00005 /* Copyright (c) 1985 - 1999, Microsoft Corporation */ 00006 /* */ 00007 /* Kanji Support Routines */ 00008 /* */ 00009 /****************************************************************************/ 00010 00011 #include "precomp.h" 00012 #pragma hdrstop 00013 00014 #ifdef KANJI 00015 00016 /***************************************************************************\ 00017 * SysHasKanji 00018 * 00019 * <brief description> 00020 * 00021 * History: 00022 \***************************************************************************/ 00023 00024 BOOL SysHasKanji( 00025 ) 00026 { 00027 return (*(WORD *)&keybdInfo.Begin_First_range != 0x0FEFF || 00028 *(WORD *)&keybdInfo.Begin_Second_range != 0x0FEFF); 00029 } 00030 00031 /***************************************************************************\ 00032 * KAlign 00033 * 00034 * Make sure the given char isn't the index of the second byte of a Kanji word. 00035 * 00036 * History: 00037 \***************************************************************************/ 00038 00039 int KAlign( 00040 PED ped, 00041 int ichIn) 00042 { 00043 int ichCheck; 00044 int ichOut; 00045 LPSTR lpch; 00046 00047 /* 00048 * ichOut chases ichCheck until ichCheck > ichIn 00049 */ 00050 if (ped->fSingle) 00051 ichOut = ichCheck = 0; 00052 else 00053 ichOut = ichCheck = ped->mpilich[IlFromIch(ped, ichIn)]; 00054 00055 lpch = ECLock(ped) + ichCheck; 00056 while (ichCheck <= ichIn) { 00057 ichOut = ichCheck; 00058 if (IsTwoByteCharPrefix(*(unsigned char *)lpch)) 00059 { 00060 lpch++; 00061 ichCheck++; 00062 } 00063 00064 lpch++; 00065 ichCheck++; 00066 } 00067 ECUnlock(ped); 00068 return (ichOut); 00069 } 00070 00071 /***************************************************************************\ 00072 * KBump 00073 * 00074 * If ichMaxSel references Kanji prefix, bump dch by cxChar to bypass prefix 00075 * char. This routine is called only from DoKey in ea1.asm. 00076 * 00077 * History: 00078 \***************************************************************************/ 00079 00080 int KBump( 00081 PED ped, 00082 int dch) 00083 { 00084 unsigned char *pch; 00085 00086 pch = ECLock(ped) + ped->ichMaxSel; 00087 if (IsTwoByteCharPrefix(*pch)) 00088 dch += ped->cxChar; 00089 ECUnlock(ped); 00090 00091 return (dch); 00092 } 00093 00094 /***************************************************************************\ 00095 * KCombine 00096 * 00097 * Kanji prefix byte was found in bytestream queue. Get next byte and combine. 00098 * 00099 * History: 00100 \***************************************************************************/ 00101 00102 int KCombine( 00103 HWND hwnd, 00104 int ch) 00105 { 00106 MSG msg; 00107 int i; 00108 00109 /* 00110 * Loop counter to avoid the infinite loop. 00111 */ 00112 i = 10; 00113 00114 while (!PeekMessage(&msg, hwnd, WM_CHAR, WM_CHAR, PM_REMOVE)) { 00115 if (--i == 0) 00116 return 0; 00117 Yield(); 00118 } 00119 00120 return (UINT)ch | ((UINT)msg.wParam << 8); 00121 } 00122 00123 #endif

Generated on Sat May 15 19:39:47 2004 for test by doxygen 1.3.7