Back to index

im-sdk  12.3.91
Functions | Variables
OnKeySym.c File Reference
#include "PYIM.h"

Go to the source code of this file.

Functions

JINT IsWantedKeysym (JINT *pks)
JINT IsQuitKeysym (JINT *pks)
JINT IsQpSpSwitchKeysym (JINT *pks)
JINT IsEditKeysym (JINT *pks)
JINT IsPageKeysym (JINT *pks)
JINT IsSelectKeysym (JINT *pks)
VOID GetAsciiFromJword (JWORD *pwJwordArray, CHAR *szAsciiArray, JINT nLen)
JINT JwordValidLen (JWORD *pwJwordArray, JINT nMaxLen)
JINT JwordStrStrReplace (JWORD *pwDst, JWORD *pwSrc1, JWORD *pwSrc2, JINT nLenSrc2)
JWORDStrToJword (CHAR *szStr)
VOID JwordInfo (JWORD *pwJwordArray, JINT nMaxLen)
VOID Jword2Uchar (JWORD *pwJword, UCHAR *szUch, JINT nMaxLen)
UCHARRecovDyz2244 (UCHAR *szDyz2244)
JWORDRecovDyzNWord2244 (JWORD *pwDyz2244, JINT nMaxLen)
VOID DecompPeIntArray (JINT *pnOutPreedit, CHAR *szDspPreedit)
VOID ParseRawInputStr (char *szPreedit, int *pnOutPreedit)
VOID InitSge (SesGuiElement *pSgeStruct)
JINT IMPinyinTrans (JINT *pKsThis, SesGuiElement *pSge)
JINT OnEditKeysym (JINT *pNextKeysym, SesGuiElement *pSge)
JINT OnPageKeysym (JINT *pNextKeysym, SesGuiElement *pSge)
JINT OnSelectKeysym (JINT *pNextKeysym, SesGuiElement *pSge)
JINT PixWidBetween (JWORD *pwPrsStr, JINT nFrom, JINT nTo)
JINT PixWidBetween_SP (JWORD *pwPrsStr, JINT nFrom, JINT nTo)
VOID GetDspPEandCaretPos (SesGuiElement *pSge)
VOID GetDspPEandCaretPos_PS (SesGuiElement *pSge)
JINT RestoreHzToPy (SesGuiElement *pSge, JINT nResFlag)
JINT YjCodeToYjStr (JINT nYjCode, CHAR *szYjStr)
JINT IsIntArrayEqual (JINT *pnIntArray1, JINT *pnIntArray2, JINT nLen)
VOID PraseMixRawPe (SesGuiElement *pSge)
JINT QpCaretToPrsCaret (JWORD *pwPrsStr, JINT nQpCaret)
VOID GetFirst9Yj (JINT *pnPrsYj, JINT *pnF9Yj, JINT *pnLen, JINT *pnMatchMode)
JINT LookupCiku (JINT *pnOrgYj, JINT nLenYj, JINT nMatchMode, SysCandi *psc, UdcCandi *puc)
JINT GetXrdCandi (SysCandi *psc, UdcCandi *puc, JINT nXrd, JWORD *pwOneCandi)
VOID ScrollViewCandiPage (SysCandi *psc, UdcCandi *puc, SesGuiElement *pSge)
VOID ListCandiInfo (SysCandi *psc, UdcCandi *puc)
JWORD RecovDyzWord2244 (JWORD wDyz2244)
JINT TypeOfSpMixWord (JWORD *pwSpMix, JINT nPos, JINT nKeyLayMode)
JINT OnSelectKeysym_SP (JINT *pNextKeysym, SesGuiElement *pSge)
JINT RestoreHzToPy_SP (SesGuiElement *pSge, JINT nResFlag)
VOID SpMix2QpMix (JWORD *pwSpMix, JWORD *pwMix, JINT nSpCaret, JINT *pnCaret, JINT nKeyLayMode)
JINT OnEditKeysym_SP (JINT *pNextKeysym, SesGuiElement *pSge, JINT nKeyLayMode)
JINT TypeOfSpChar (CHAR *pszOrgSp, JINT nPos, JINT nKeyLayMode)
JINT IsValidSpSuite (CHAR chSM, CHAR chYM, JINT nKeyLayMode)
VOID GetIehFromSge (ImToXSun *pIeh, SesGuiElement *pSge)
VOID ProcSymbIMKey (SesGuiElement *pSge, JINT nSymbType, JINT *pNextKeysym, ImToXSun *pIeh)
JINT PrepareSymbolSge (SesGuiElement *pSge, JINT nSymbType)
VOID ProcAllKeysym (JINT *pKsThis, SesGuiElement *pSge)
VOID GetDspPEandCaretPos_SP (SesGuiElement *pSge)

Variables

JWORDpwNewpySym []
JINT nGlobalSpMode

Function Documentation

VOID DecompPeIntArray ( JINT pnOutPreedit,
CHAR szDspPreedit 
)

Definition at line 63 of file ParsePreedit.c.

{
       JINT    i, j, tmp;
       JINT    nHalfMatchLen, nIUVetc, nYJCode;
       CHAR    szHalfMatch[7];
       
       i   = 0;
       tmp = 1;

       for (i = 0; i < 256; i++)
              szDspPreedit[i] = '\0';
              
       for (i = 0; pnOutPreedit[i] != 0; )
       {
              tmp = pnOutPreedit[i];
              nYJCode = tmp & 0x01FF;
              nIUVetc = (tmp >> 9) & 0x07;
              nHalfMatchLen = (tmp >> 12) & 0x0F;
              
              if (nIUVetc != 0)
              {
                     if (nIUVetc == 6)                        /* [$] */
                     {
                            strcat (szDspPreedit, "$");
                            i++;
                     }
                     else if (nIUVetc == 5)                   /* [#] */
                     {
                            strcat (szDspPreedit, "#");
                            i++;
                     }
                     else if (nIUVetc == 4)                   /* ['] */
                     {
                            strcat (szDspPreedit, "\'");
                            i++;
                     }
                     else                                      /* [i u v] */
                     {
                            /*
                            **  Add a space before [iuv] except that this is 
                            **  the first CHAR in Preedit string or a ['ivu]
                            **  ahead it.
                            **  MakeOPE(0, 1, 0) is 0000 001 000000000 = 0x0200 [i]
                            **  MakeOPE(0, 2, 0) is 0000 010 000000000 = 0x0400 [u]
                            **  MakeOPE(0, 3, 0) is 0000 011 000000000 = 0x0600 [v]
                            **  MakeOPE(0, 4, 0) is 0000 100 000000000 = 0x0800 [']
                            **
                            **  [#] and [$] don't affect [SPACE]
                            **
                            **  MakeOPE(0, 5, 0) is 0000 101 000000000 = 0x0A00 [#]
                            **  MakeOPE(0, 6, 0) is 0000 110 000000000 = 0x0C00 [$]
                            */
                            if ( (i > 0) && (pnOutPreedit[i-1] != 0x0200)    \
                                         && (pnOutPreedit[i-1] != 0x0400)    \
                                         && (pnOutPreedit[i-1] != 0x0600)    \
                                         && (pnOutPreedit[i-1] != 0x0800) )
                                   strcat (szDspPreedit, " ");
                            
                            if (nIUVetc == 1)
                                   strcat (szDspPreedit, "i");
                            else  if (nIUVetc == 2)
                                   strcat (szDspPreedit, "u");
                            else  if (nIUVetc == 3)
                                   strcat (szDspPreedit, "v");
                            i++;
                     }
              }
              
              else if ((nIUVetc == 0) && (nHalfMatchLen == 6))
              {
                     /*
                     ** A valid Yinjie code. Add a SPACE before
                     ** Yinjie string expect that there is a ['] ahead or it is the first.
                     ** MakeOPE(0, 4, 0) is 0000 100 000000000 = 0x0800
                     */
                     if ((i > 0) && (pnOutPreedit[i-1] != 0x0800))
                            strcat (szDspPreedit, " ");
                     
                     if (nYJCode >= 450)
                            strcat (szDspPreedit, SHENGMUSTR[nYJCode - 450]);
                     else if (nYJCode < 450)
                            strcat (szDspPreedit, YINJIESTR_CSZ[nYJCode]);
                            
                     i++;
              }
              
              else if ((nHalfMatchLen > 0) && (nHalfMatchLen < 6) && (nIUVetc == 0))
              {
                     for (j = 0; j < nHalfMatchLen; j++)
                            szHalfMatch[j] = (char)pnOutPreedit[i + j + 1];
                     szHalfMatch[j] = '\0';
                     if ((i > 0) && (pnOutPreedit[i-1] != 0x0800))
                            strcat (szDspPreedit, " ");
                     strcat (szDspPreedit, szHalfMatch);
                     i += (j + 1);
              }
              else
              {
                     i++;
                     fprintf (stderr, "Error in DecompPeIntArray()\n");
              }
       }
       
}
VOID GetAsciiFromJword ( JWORD pwJwordArray,
CHAR szAsciiArray,
JINT  nLen 
)

Definition at line 249 of file Jword.c.

{
       JINT   i, j;
       
       i = j = 0;
       for (i = 0; i < nLen; i++)
       {
              if ( *(pwJwordArray + i) < 0x0080)
              {
                     *(szAsciiArray + j) = (CHAR)(*(pwJwordArray + i));
                     j++;
              }
       }
       
       for ( ; j < nLen; j++)
              *(szAsciiArray + j) = '\0';
}

Definition at line 857 of file OnKeySym.c.

{
       JINT    nTotLen, i, j, t1, t2, t3;
       
       JINT    nFrom, nTo, nRawCaret, nPrsCaretPos;
       
       nFrom     = pSge->nViewPeStart;
       nTo       = pSge->nViewPeEnd;
       nRawCaret = pSge->nRawCaretPos;
       
/*
       ==>[szOrgSp]>>vs#hw#rf#mn#gs#he#go#mz#tm#bu [29]
       ==>[  szQp ]>>zhong#hua#ren#min#gong#he#guo#mei#tian#bu [41]
       pwPrsMixStr >>zhong# hua# ren# min# gong# he# guo# mei# tian# bu [50]
       nLenSp is 29 nSpRawCaretPos[29], nLenQp is 41 nRawCaretPos[41]
       [nViewPeStart][ 0]  [nViewPeEnd][50]  [nRawCaretPos][41]
*/

       nTotLen      = JwordValidLen(pSge->pwPrsMixStr, UTWO);
       nPrsCaretPos = QpCaretToPrsCaret(pSge->pwPrsMixStr, pSge->nRawCaretPos);
       
       t1 = t2 = t3 = j = 0;
       for (i = 0; i <= nTotLen; i++)
       {
              if (i == nFrom)
                     t1 = i;
              if (i == nTo)
                     t2 = i;
              if (i == nPrsCaretPos)
                     t3 = i;
       }
       
       assert((t3 <= t2) && (t3 >= t1));

       pSge->nViewCaretPos = t3 - t1;

       for (i = t1; i < t2; i++)
              pSge->pwViewPe[i - t1] = pSge->pwPrsMixStr[i];
       pSge->pwViewPe[t2 - t1] = 0;
       
       if (t1 == 0)
              pSge->nIconFlag &= (~F_LEFTARROW);
       else
              pSge->nIconFlag |= F_LEFTARROW;
              
       if ( t2 >= (nTotLen - 1))
              pSge->nIconFlag &= (~F_RIGHTARROW);
       else
              pSge->nIconFlag |= F_RIGHTARROW;

}

Here is the call graph for this function:

VOID GetFirst9Yj ( JINT pnPrsYj,
JINT pnF9Yj,
JINT pnLen,
JINT pnMatchMode 
)

Definition at line 545 of file ParsePreedit.c.

{
       JINT    i, nTmp1, nTmp2;
       JINT    nHalfMatchLen, nIUVetc, nYjcode;
       
       for(i = 0; i < 9; i++)
              pnF9Yj[i] = 0;

       *pnMatchMode = LU_MATCH_WIDELY;
       *pnLen       = 0;
       
       for (i = 0; (pnPrsYj[i] != 0) && ((*pnLen) < 9); )
       {
              nTmp1   = pnPrsYj[i];
              nTmp2   = pnPrsYj[i + 1];

              nYjcode       = nTmp1 & 0x01FF;
              nIUVetc       = (nTmp1 >> 9) & 0x07;
              nHalfMatchLen = (nTmp1 >> 12) & 0x0F;
              
              if ((nIUVetc == 0) && (nHalfMatchLen == 6))
              {
                     pnF9Yj[*pnLen] = nYjcode;
                     (*pnLen)++;
                     i++;
              }
              else if ((nIUVetc == 4) || (nIUVetc == 5) || (nIUVetc == 6))           /* ['][#][$] */
              {
                     i++;
                     nYjcode       = nTmp2 & 0x01FF;
                     nIUVetc       = (nTmp2 >> 9) & 0x07;
                     nHalfMatchLen = (nTmp2 >> 12) & 0x0F;
                     
                     if ((nIUVetc == 0) && (nHalfMatchLen == 6))
                     {
                            pnF9Yj[*pnLen]  = nYjcode + ((nIUVetc - 3) << 16);
                            (*pnLen)++;
                            i ++;
                     }
                     else
                     {
                            *pnMatchMode = LU_MATCH_STRICT;
                            break;
                     }
              }
              else
              {
                     *pnMatchMode = LU_MATCH_STRICT;
                     break;
              }
       }

       if (*pnMatchMode == LU_MATCH_WIDELY)
       {
              nTmp1   = pnPrsYj[i];

              nYjcode       = nTmp1 & 0x01FF;
              nIUVetc       = (nTmp1 >> 9) & 0x07;
              nHalfMatchLen = (nTmp1 >> 12) & 0x0F;
       
              if (nTmp1 == 0)
                     *pnMatchMode = LU_MATCH_WIDELY;
              else if ((nTmp1 != 0) && ((nIUVetc != 0) || (nHalfMatchLen != 6)))
                     *pnMatchMode = LU_MATCH_STRICT;
       }
}
VOID GetIehFromSge ( ImToXSun pIeh,
SesGuiElement pSge 
)

Definition at line 676 of file NewPYLE.c.

{
       JINT   i, j;
       
       for (i = 0; i < 128; i++)
              pIeh->pwPreedit[i] = pSge->pwViewPe[i];
              
       pIeh->nCaretPos  = pSge->nViewCaretPos;
       
       pIeh->nChoiceNum = pSge->nViewCandiEnd - pSge->nViewCandiStart;
       for (i = 0; i < 8; i++)
              for (j = 0; j < 24; j++)
                     pIeh->pwLookupChoice[i][j] = 0x0000;
       
       GetLookupChoiceFromCandi(pIeh, pSge->pwViewCandi);
       
       for (i = 0; i < 16; i++)
              pIeh->pwStatus[i] = pSge->pwStatus[i];
       
       /* Because nErrorCode was cleared before each new KeySym Process */
       if (pSge->nErrorCode != 0)
       {
              pIeh->nType = IMXSUN_TYPE_ERROR;
              pIeh->nErrorCode = pSge->nErrorCode;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

JINT GetXrdCandi ( SysCandi psc,
UdcCandi puc,
JINT  nXrd,
JWORD pwOneCandi 
)

Definition at line 1302 of file OnKeySym.c.

{
       JINT    i, k, m, nTmp;
       JINT    nRet;
       JINT    nNumSpec, nNumUdc28, nNumMh, nNumDh, nNumSh, nNumGbk;
       
       nRet  = 0;
       nNumSpec  = puc->nNumSpecCandi;
       nNumUdc28 = puc->nNumUdc28Candi;
       nNumMh    = psc->nNumMhCandi;
       nNumDh    = psc->nNumDhCandi;
       nNumSh    = psc->nNumShCandi;
       nNumGbk   = psc->nNumGbkCandi;

       nTmp  = nNumSpec + nNumUdc28 + nNumMh + nNumDh + nNumSh + nNumGbk;    
       if ((nXrd < 0) || (nXrd > (nTmp - 1)))
              return nRet;
       
       /* SpecHz */
       if (nXrd < nNumSpec)                       /* [0 ~ (nNumSpecCandi - 1)] */
       {
              pwOneCandi[0] = puc->pwSpecCandi[nXrd];
              nRet = 1;
              return nRet;
       }
       /* Udc28 */
       else if ((nXrd >= nNumSpec) && (nXrd < (nNumSpec + nNumUdc28)))
       {
              m = nNumSpec;
              for (k = 0; k < puc->nSizUdc28Candi; k++)
              {
                     if (m == nXrd)
                     {
                            k++;
                            for(i = 0; puc->pwUdc28Candi[k] != 0x0000;  )
                                   pwOneCandi[i++] = puc->pwUdc28Candi[k++];
                            nRet = i;
                            break;           /* 退出k++的BREAK, NOT i++ */
                     }
                     else if (puc->pwUdc28Candi[k] == 0x0000)
                            m++;
              }
       }
       /* Mh */
       else if ( (nXrd >= (nNumSpec + nNumUdc28)) && 
               (nXrd < (nNumSpec + nNumUdc28 + nNumMh)) )
       {
              m = nNumSpec + nNumUdc28;
              for (k = 0; k < psc->nSizMhCandi; k++)
              {
                     if (m == nXrd)
                     {
                            k++;
                            for(i = 0; psc->pwMhCandi[k] != 0x0000;  )
                                   pwOneCandi[i++] = psc->pwMhCandi[k++];
                            nRet = i;

                            break;           /* 退出k++的BREAK, NOT i++ */
                     }
                     else if (psc->pwMhCandi[k] == 0x0000)
                            m++;
              }
       }
       /* Dh */
       else if ( (nXrd >= (nNumSpec + nNumUdc28 + nNumMh)) && 
               (nXrd < (nNumSpec + nNumUdc28 + nNumMh + nNumDh)) )
       {
              m = nNumSpec + nNumUdc28 + nNumMh;
              for (k = 0; k < psc->nSizDhCandi; k++)
              {
                     if (m == nXrd)
                     {
                            k++;
                            for (i = 0; psc->pwDhCandi[k] != 0x0000;  )
                                   pwOneCandi[i++] = psc->pwDhCandi[k++];
                            nRet = i;
                            break;           /* 退出k++的BREAK, NOT i++ */
                     }
                     else if (psc->pwDhCandi[k] == 0x0000)
                            m++;
              }
              nRet  = 2;
       }
       /*
       **  Sh
       **  Special Consideration for Single Hanzi Area: Because there is 'Xian' Question
       **  Here!!!! nRet may be 2.
       */
       else if ((nXrd >= (nNumSpec + nNumUdc28 + nNumMh + nNumDh)) && 
               (nXrd < (nNumSpec + nNumUdc28 + nNumMh + nNumDh + nNumSh)) )
       {
              m = nNumSpec + nNumUdc28 + nNumMh + nNumDh;
              for (k = 0; k < psc->nSizShCandi; k++)
              {
                     if (m == nXrd)
                     {
                            for (i = 0; psc->pwShCandi[k] != 0x0000;  )
                                   pwOneCandi[i++] = psc->pwShCandi[k++];
                            nRet = i;
                            break;           /* 退出k++的BREAK, NOT i++ */
                     }
                     else if (psc->pwShCandi[k] == 0x0000)
                            m++;
              }
       }
       /*Gbk */
       else if ((nXrd >= (nNumSpec + nNumUdc28 + nNumMh + nNumDh + nNumSh)) && 
               (nXrd < (nNumSpec + nNumUdc28 + nNumMh + nNumDh + nNumSh + nNumGbk)) )
       {
              m = nNumSpec + nNumUdc28 + nNumMh + nNumDh + nNumSh;
              for (k = 0; k < psc->nSizGbkCandi; k++)
              {
                     if (m == nXrd)
                     {
                            for (i = 0; psc->pwGbkCandi[k] != 0x0000;  )
                                   pwOneCandi[i++] = psc->pwGbkCandi[k++];
                            nRet = i;
                            break;           /* 退出k++的BREAK, NOT i++ */
                     }
                     else if (psc->pwGbkCandi[k] == 0x0000)
                            m++;
              }
       }
       else
       {
              fprintf(stderr, "nXrd is too Large!! in function GetXrdCandi().\n");
              nRet = 0;
       }
       
       return nRet;
}
JINT IMPinyinTrans ( JINT pKsThis,
SesGuiElement pSge 
)
VOID InitSge ( SesGuiElement pSgeStruct)

Definition at line 599 of file NewPYLE.c.

{
       JINT    i;
       
       pSgeStruct->nSpRawCaretPos    = 0;

       for (i = 0; i < 40; i++)
              pSgeStruct->pwSpRawPyStr[i]  = 0x0000;
       for (i = 0; i < UONE; i++)
              pSgeStruct->pwSpMixPeStr[i]  = 0x0000;
       for (i = 0; i < UTWO; i++)
              pSgeStruct->pwSpSlctRawPy[i] = 0x0000;
       
       for (i = 0; i < UONE; i++)
       {
              pSgeStruct->pwRawPyStr[i]    = 0x0000;
              pSgeStruct->pwMixPeStr[i]    = 0x0000;
              pSgeStruct->nPrsPyYjCode[i]  = 0;
              pSgeStruct->pwCommit[i]      = 0x0000;
       }
       
       for (i = 0; i < UTWO; i++)
       {
              pSgeStruct->pwPrsPyStr[i]    = 0x0000;
              pSgeStruct->pwPrsMixStr[i]   = 0x0000;
              pSgeStruct->pwSlctHz[i]      = 0x0000;
              pSgeStruct->pwSlctRawPy[i]   = 0x0000;
       }
       
       for (i = 0; i < UHLF; i++)
       {
              pSgeStruct->pwViewPe[i]      = 0x0000;
              pSgeStruct->pwViewCandi[i]   = 0x0000;
       }
       
/*
       pSgeStruct->nPinyinType       = -1;
*/
       pSgeStruct->nPrevKeyLayMode   = pSgeStruct->nKeyLayMode;
/*
       pSgeStruct->nPunctMode        = 0;   
*/
       
       pSgeStruct->nRawCaretPos      = 0;
       pSgeStruct->nViewCaretPos     = 0;
       pSgeStruct->nViewPage         = 0;
       pSgeStruct->nViewPeStart      = 0;
       pSgeStruct->nViewPeEnd        = 0;
       pSgeStruct->nViewCandiStart   = 0;
       pSgeStruct->nViewCandiEnd     = 0;
       pSgeStruct->nSlctSteps        = 0;

       for (i = 0; i < 16; i++)
              pSgeStruct->pwStatus[i]   = 0x0000;
       pSgeStruct->nErrorCode        = 0;

       pSgeStruct->nIconFlag = F_HALFWIDTH | F_SETUP;
       
       InitStructSc(&(pSgeStruct->scSysCandi));
       InitStructUc(&(pSgeStruct->ucUdcCandi));

       /* The following 3 items were added to Fix Bug 4165549: Scott Ma, 12/8, 1998 */
       pSgeStruct->nPrevMatchMode       = -1;
       for (i = 0; i < 9; i++)
       {
              pSgeStruct->pnCurChoiceYjNew[i] = 1;
              pSgeStruct->pnCurChoiceYjOld[i] = 0;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

JINT IsEditKeysym ( JINT pks)

Definition at line 115 of file KeysymType.c.

{
       JINT   i, nLen;
       
       nLen = 0;
       for (i = 0; (i < SUN_NUM_KEYSYM) && (pks[i] != 0x0L); i++)
              nLen ++;
              
       if (nLen == 0)
              return FALSE;
       
       /*
       **  The following range is fetched from file "IMWantedKey.h"
       **  There maybe some ingoration about "IMXK_KP_xxx". Check it later.
       **
       **  Notice: A Self defined Keysym IMXK_REDRAW_INTERNAL was added! 0xEEEE
       */
       if( (pks[0] == IMXK_Escape)      ||
           (pks[0] == IMXK_quoteright)  ||
           (pks[0] == IMXK_Delete)      ||
           (pks[0] == IMXK_BackSpace)   ||
           (pks[0] == IMXK_Left)        ||
           (pks[0] == IMXK_Right)       ||
           (pks[0] == IMXK_Home)        ||
           (pks[0] == IMXK_End)         ||
           (pks[0] == IMXK_REDRAW_INTERNAL)      ||
           ((pks[0] >= IMXK_a) && (pks[0] <= IMXK_z)) 
         )
              return TRUE;
       return FALSE;
}

Here is the caller graph for this function:

JINT IsIntArrayEqual ( JINT pnIntArray1,
JINT pnIntArray2,
JINT  nLen 
)
JINT IsPageKeysym ( JINT pks)

Definition at line 175 of file KeysymType.c.

{
       JINT   i, nLen;
       
       nLen = 0;
       for (i = 0; (i < SUN_NUM_KEYSYM) && (pks[i] != 0x0L); i++)
              nLen ++;
              
       if (nLen == 0)
              return FALSE;
       
       if( (pks[0] == IMXK_minus)      ||
           (pks[0] == IMXK_equal)          ||
           (pks[0] == IMXK_bracketleft)    ||
           (pks[0] == IMXK_bracketright)   ||
           (pks[0] == IMXK_comma)          ||
           (pks[0] == IMXK_MOUSEPREV)      ||
           (pks[0] == IMXK_MOUSENEXT)      ||
           (pks[0] == IMXK_period)         ||
           (pks[0] == IMXK_Return) )
              return TRUE;
       return FALSE;
}

Here is the caller graph for this function:

Definition at line 66 of file KeysymType.c.

{
       if (pks[0] == IMXK_ALT_QP_SP)
              return TRUE;
       return FALSE; 
}

Here is the caller graph for this function:

JINT IsQuitKeysym ( JINT pks)

Definition at line 58 of file KeysymType.c.

{
       if (pks[0] == IMXK_QUIT_PYIM)
              return TRUE;
       return FALSE; 
}

Here is the caller graph for this function:

JINT IsSelectKeysym ( JINT pks)

Definition at line 200 of file KeysymType.c.

{
       JINT   i, nLen;
       
       nLen = 0;
       for (i = 0; (i < SUN_NUM_KEYSYM) && (pks[i] != 0x0L); i++)
              nLen ++;
              
       if (nLen == 0)
              return FALSE;
       
       if( (pks[0] == IMXK_space)  ||
           ((pks[0] >= IMXK_0) && (pks[0] <= IMXK_9)) )
              return TRUE;
       return FALSE;
}

Here is the caller graph for this function:

JINT IsValidSpSuite ( CHAR  chSM,
CHAR  chYM,
JINT  nKeyLayMode 
)

Definition at line 2595 of file PyBasic.c.

{
       CHAR    szYjTmp1[10], szYjTmp2[10];
       JINT    nKeyLayYM1, nKeyLayYM2, nKeyLaySM;
       JINT    i, m, nRes;
       JINT    nNullYj[8] = {27, 50, 64, 82, 90, 152, 235, 285};

       assert(((chSM >= 'a') && (chSM <= 'z')) || ((chSM >= 'A') && (chSM <= 'Z')));
       assert(((chYM >= 'a') && (chYM <= 'z')) || ((chYM >= 'A') && (chYM <= 'Z')));

       if ((Lower(chSM) == 'i') || (Lower(chSM) == 'u') || (Lower(chSM) == 'v'))
       {
              nKeyLaySM   = KEYLAYMODE[nKeyLayMode][Lower(chSM) - 'a'] >> 16;
              szYjTmp1[0] = szYjTmp2[0] = YUNMUSTR[nKeyLaySM][0];
              szYjTmp1[1] = szYjTmp2[1] = YUNMUSTR[nKeyLaySM][1];
              szYjTmp1[2] = szYjTmp2[2] = '\0';
              m = 2;    /* length of ShengMu */
       }
       else
       {
              szYjTmp1[0] = szYjTmp2[0] = Lower(chSM);
              szYjTmp1[1] = szYjTmp2[1] = '\0';
              m = 1;    /* length of ShengMu */
       }

       nKeyLayYM1  =  KEYLAYMODE[nKeyLayMode][Lower(chYM) - 'a'] & 0x0000FF;
       nKeyLayYM2  = (KEYLAYMODE[nKeyLayMode][Lower(chYM) - 'a'] & 0x00FF00) >> 8;

       /* ShengMu just before it is [aeo] */
       if ((chSM == 'a') || (chSM == 'e') || (chSM == 'o'))
              szYjTmp1[0]  = szYjTmp2[0] = '\0';

       strcat(szYjTmp1, YUNMUSTR[nKeyLayYM1]);
       nRes = FastMatchYinJieStr(szYjTmp1);

       /* Process for Null Yinjie in "zh" locale. Scott Ma 98-05-13 */
#ifndef _DRAW_IM_WIN_H
       if (strcmp(szLocale, "zh") == 0)
       {
              for (i = 0; i < 8; i++)
              {
                     if (nRes == nNullYj[i])
                     {
                            nRes = -1;
                            break;
                     }
              }
       }
#endif

       if ((nRes >= 0) && (nRes < NUM_YINJIE))
              return TRUE;

       if ((nRes == -1) && (nKeyLayYM2 != 0))
       {
              strcat(szYjTmp2, YUNMUSTR[nKeyLayYM2]);
              nRes = FastMatchYinJieStr(szYjTmp2);

              /* Process for Null Yinjie in "zh" locale. Scott Ma 98-05-13 */
#ifndef _DRAW_IM_WIN_H
              if (strcmp(szLocale, "zh") == 0)
              {
                     for (i = 0; i < 8; i++)
                     {
                            if (nRes == nNullYj[i])
                            {
                                   nRes = -1;
                                   break;
                            }
                     }
              }
#endif

              if ((nRes >= 0) && (nRes < NUM_YINJIE))
                     return TRUE;
       }
       
       return FALSE;
}

Here is the call graph for this function:

JINT IsWantedKeysym ( JINT pks)

Definition at line 74 of file KeysymType.c.

{
       JINT   i, nLen;
       
       nLen = 0;
       for (i = 0; (i < SUN_NUM_KEYSYM) && (pks[i] != 0x0L); i++)
              nLen ++;
              
       if (nLen == 0)
              return FALSE;
       
       /*
       **  The following range is fetched from file "IMKeyMap.h"
       **  There maybe some ingoration about "IMXK_KP_xxx". Check it later.
       **
       **  Notice: Internal pesudo_keysym REDRAW_INTERNAL was added !!!! 0xEEEE
       */
       if( ( pks[0] == IMXK_BackSpace)     ||
           ( pks[0] == IMXK_Linefeed)   ||
           ( pks[0] == IMXK_Return)     ||
           ( pks[0] == IMXK_Escape)     ||
           ( pks[0] == IMXK_Multi_key)  ||
           ( pks[0] == IMXK_MOUSEPREV)  ||
           ( pks[0] == IMXK_MOUSENEXT)  ||
           ( pks[0] == IMXK_Clear)        ||
           ((pks[0] >= IMXK_Home) && (pks[0] <= IMXK_Begin))           ||
           ((pks[0] >= IMSunXK_AltGraph) && (pks[0] <= IMXK_KP_Space)) ||
           ((pks[0] >= IMXK_KP_Home) && (pks[0] <= IMXK_KP_Begin))     ||
           ( pks[0] == IMXK_KP_Delete)  ||
           ((pks[0] >= IMXK_KP_Multiply) && (pks[0] <= IMXK_KP_9))     ||
           ((pks[0] >= IMXK_Shift_L) && (pks[0] <= IMXK_Alt_R))        ||
           ((pks[0] >= IMXK_space) && (pks[0] <= IMXK_asciitilde))     ||
           ( pks[0] == IMXK_Delete)        ||
           ( pks[0] == IMXK_REDRAW_INTERNAL)     
         )
              return TRUE;
              
       return FALSE;
}

Here is the caller graph for this function:

VOID Jword2Uchar ( JWORD pwJword,
UCHAR szUch,
JINT  nMaxLen 
)

Definition at line 275 of file Jword.c.

{
       JINT     i, j;
       
       j = 0;
       for(i = 0; i < nMaxLen; i++)
       {
              if(pwJword[i] >= 0x0100)           /* OR 0x8140: First char defined in GBK */
              {
                     szUch[j++] = (UCHAR)((pwJword[i] & 0xFF00) >> 8);
                     szUch[j++] = (UCHAR)(pwJword[i] & 0x00FF);
              }
              else
                     szUch[j++] = (UCHAR)(pwJword[i] & 0x00FF);
       }
}
VOID JwordInfo ( JWORD pwJwordArray,
JINT  nMaxLen 
)

Definition at line 89 of file Jword.c.

{
       JINT    i, j, nLen;
       JWORD   wTmp;
       UCHAR   szStr[1024];
       
       nLen = JwordValidLen(pwJwordArray, nMaxLen);

       memset(szStr, '\0', 1024);

       i = j = 0;
       for (i = 0; i < nLen; i++)
       {
              wTmp = *(pwJwordArray + i);
              if ( (wTmp & 0xFF00) > 0)
              {
                     *(szStr + j) = (UCHAR)(( wTmp & 0xFF00) >> 8);
                     j++;
                     
                     *(szStr + j) = (UCHAR)(wTmp & 0x00FF);
                     j++;
              }
              else if ((wTmp < 0x0080) && (wTmp != 0x0009))
              {
                     *(szStr + j)  = (UCHAR)(wTmp & 0x00FF);
                     j++;
              }
       }
       
       fprintf (stderr, "%d  %s\n", j, szStr);
/*     fprintf (stderr, "%d  %s\n", j, RecovDyz2244(szStr));   */
}
JINT JwordStrStrReplace ( JWORD pwDst,
JWORD pwSrc1,
JWORD pwSrc2,
JINT  nLenSrc2 
)

Definition at line 135 of file Jword.c.

{
       JINT   i, j, k, nLenDst, nLenSrc1, nFoundFlag, nFirstAddr;
       
       nFoundFlag = 0;
       nLenDst    = JwordValidLen(pwDst, 256);
       nLenSrc1   = JwordValidLen(pwSrc1, 80);
       
       /*
       **  Find the startup offset in PwDst.
       **  THE FOLLOWING CODE TO BE TESTED TO REPLACE ABOVE CODE!! MXL 97-12-06
       */
       i = j = k = 0;
       for(i = 0; (i < nLenDst) && (j < nLenSrc1); i++)
       {
              if (pwDst[i] == pwSrc1[j])
                     j++;
              else
                     j = 0;
       }

       if (j == nLenSrc1)
       {
#ifdef _DEBUG
              /* If there is a SPACE char in the end of found pwSrc1 in pwDst. */
              if ( pwDst[i] == (JWORD)' ')
              {
                     fprintf (stderr, "JwordStrStrReplace():  THERE IS A SPACE!\n");
                     nLenSrc1 += 1;
              }
#endif

              /* 
              **  NOTES: Don't change the sequence of the following exchange and 
              **  the FOR sentence sequence 
              */
              nFirstAddr = i - j;
              if (nLenSrc1 >= nLenSrc2)
              {
                     for (i = nFirstAddr; i < (nFirstAddr + nLenSrc2); i++)
                            pwDst[i]  = pwSrc2[i - nFirstAddr];
                     for (i = (nFirstAddr + nLenSrc2); i < (nLenDst - (nLenSrc1 - nLenSrc2)); i++)
                            pwDst[i]  = pwDst[i + (nLenSrc1 - nLenSrc2)];
                     for (i = (nLenDst - (nLenSrc1 - nLenSrc2)); i < 256; i++)
                            pwDst[i]  = 0x0000;
              }
              else if (nLenSrc1 < nLenSrc2)
              {
                     for (i = (nLenDst + (nLenSrc2 - nLenSrc1)); i < 256; i++)
                            pwDst[i]  = 0x0000;
                     for (i = (nFirstAddr + nLenSrc2); i < (nLenDst + nLenSrc2 - nLenSrc1); i++)
                            pwDst[i]  = pwDst[i - (nLenSrc2 - nLenSrc1)];
                     for (i = nFirstAddr; i < (nFirstAddr + nLenSrc2); i++)
                            pwDst[i]  = pwSrc2[i - nFirstAddr];
              }
              return TRUE;
       }
       else
       {
#ifdef _DEBUG
              fprintf(stderr, "Cannot find string to be replaced in pwdst. JwordStrStrReplace().\n");
#endif
              return FALSE;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

JINT JwordValidLen ( JWORD pwJwordArray,
JINT  nMaxLen 
)

Definition at line 206 of file Jword.c.

{
       JINT   i, nValidLen;
       
       i = 0;
       nValidLen = 0;
       while ((i < nMaxLen) && (*(pwJwordArray + i) != 0))
       {
              i++;
              nValidLen++;
       }
              
       return nValidLen;
}
VOID ListCandiInfo ( SysCandi psc,
UdcCandi puc 
)
JINT LookupCiku ( JINT pnOrgYj,
JINT  nLenYj,
JINT  nMatchMode,
SysCandi psc,
UdcCandi puc 
)

Definition at line 930 of file CikuOper.c.

{
       JINT    nSize, i;

       nSize = 0;

       InitStructSc(psc);
       InitStructUc(puc);
       
       /* 
       ** Set the content of psc->nOrgYj and pscYj->nLenYj    AND 
       ** Filter those Yjcode which start with a [']. 
       */
       for(i = 0; i < nLenYj; i++)
       {
              psc->nOrgYj[i]  = pnOrgYj[i];
              pnOrgYj[i]     &= 0x0000FFFF;
       }
       psc->nLenYj  = nLenYj;
       
       EnumCandi(pnOrgYj, nLenYj, psc, puc, &nSize, nMatchMode, LU_CANDI_CALC);
       
       psc->pwMhCandi    = (JWORD*)malloc((psc->nSizMhCandi  + MALIGN) * sizeof(JWORD));
       psc->pwDhCandi    = (JWORD*)malloc((psc->nSizDhCandi  + MALIGN) * sizeof(JWORD));
       psc->pwShCandi    = (JWORD*)malloc((psc->nSizShCandi  + MALIGN) * sizeof(JWORD));
       psc->pwGbkCandi   = (JWORD*)malloc((psc->nSizGbkCandi + MALIGN) * sizeof(JWORD));
       puc->pwUdc28Candi = (JWORD*)malloc((puc->nSizUdc28Candi + MALIGN) * sizeof(JWORD));

       if ((psc->pwMhCandi == NULL)  || (psc->pwDhCandi == NULL) || (psc->pwShCandi == NULL) || 
              (psc->pwGbkCandi == NULL) || (puc->pwUdc28Candi == NULL) )
       {
              fprintf(stderr, "Error!! Failed to Malloc() in Function LookupCiku().\n");
              return FALSE;
       }

       memset(psc->pwMhCandi,  '\0', (psc->nSizMhCandi  + MALIGN) * sizeof(JWORD));
       memset(psc->pwDhCandi,  '\0', (psc->nSizDhCandi  + MALIGN) * sizeof(JWORD));
       memset(psc->pwShCandi,  '\0', (psc->nSizShCandi  + MALIGN) * sizeof(JWORD));
       memset(psc->pwGbkCandi, '\0', (psc->nSizGbkCandi + MALIGN) * sizeof(JWORD));
       memset(puc->pwUdc28Candi, '\0', (puc->nSizUdc28Candi + MALIGN) * sizeof(JWORD));
       
       EnumCandi(pnOrgYj, nLenYj, psc, puc, &nSize, nMatchMode, LU_CANDI_WRITE);
       
       /* Additional Process for Spec Hanzi Candi, MXL 98.01.12 */
       if (0 == (psc->nNumMhCandi + psc->nNumDhCandi + puc->nNumUdc28Candi))
              puc->nNumSpecCandi = 0;
       
       /* Sort Candidates in structure SysCandi and UdcCandi by Frequence */
       SortCandi(psc, puc);
       
       return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JINT OnEditKeysym ( JINT pNextKeysym,
SesGuiElement pSge 
)
JINT OnEditKeysym_SP ( JINT pNextKeysym,
SesGuiElement pSge,
JINT  nKeyLayMode 
)
JINT OnPageKeysym ( JINT pNextKeysym,
SesGuiElement pSge 
)
JINT OnSelectKeysym ( JINT pNextKeysym,
SesGuiElement pSge 
)
JINT OnSelectKeysym_SP ( JINT pNextKeysym,
SesGuiElement pSge 
)
VOID ParseRawInputStr ( char *  szPreedit,
int *  pnOutPreedit 
)

Definition at line 196 of file ParsePreedit.c.

{
       CHAR    szNextUnit[10];
       JINT    nPELen;
       JINT    nCurOff, nOPEOff, nRef, nPy;
       JINT    nMatchFlag,  nMatchSMLen,  nMatchYMLenFit,  nMatchYMLenMax,  nMatchYinjie;
       JINT    nMatchFlag2, nMatchSMLen2, nMatchYMLenFit2, nMatchYMLenMax2, nMatchYinjie2;
       JINT    i, j, tmp, tmp1, tmp2;
       CHAR    cEnd, cNext;
       
       JINT    nHalfMatchLen, nIUVetc, nYJCode;

       nHalfMatchLen = nIUVetc = nYJCode = 0;
       nCurOff       = 0;
       nRef = nPy = 0;
       nOPEOff    = 0;
       
       nPELen = (int)strlen(szPreedit);
       
       while (nPELen > nCurOff)
       {
              for (i = 0; i < 10; i++)
                     szNextUnit[i] = '\0';
              
              tmp  = GetNextUnit(szPreedit, nCurOff, szNextUnit);
              nRef = (tmp >> 8) & 0x00FF;
              nPy  = tmp & 0x00FF;

              if (nRef == 1)           /* a ['] */
              {
                     pnOutPreedit[nOPEOff] = MakeOPE (0, 4, 0);
                     nOPEOff ++;
                     nCurOff ++;
              }
              else if (nRef == 2)      /* a [#] */
              {
                     pnOutPreedit[nOPEOff] = MakeOPE (0, 5, 0);
                     nOPEOff ++;
                     nCurOff ++;
              }
              else if (nRef == 3)      /* a [$] */
              {
                     pnOutPreedit[nOPEOff] = MakeOPE (0, 6, 0);
                     nOPEOff ++;
                     nCurOff ++;
              }
              
              if (nPy == 0)
              {
#ifdef _DEBUG
                     fprintf (stderr, "ParseRawInputStr() was exited from [nPy == 0]\n");
#endif
                     nCurOff = nPELen;    /* break;  OR: nCurOff = nPELen; */
              }
              else                        /* nPy > 0 */
              {
                     tmp = MatchUnitByYinjie (szNextUnit);
                     nMatchYMLenFit = (tmp >> 16) & 0x07;
                     nMatchFlag = (tmp >> 13) & 0x07;
                     nMatchSMLen = (tmp >> 12) & 0x01;
                     nMatchYMLenMax = (tmp >> 9) & 0x07;
                     nMatchYinjie = tmp & 0x01FF;
                     
                     tmp1 = nCurOff + nMatchSMLen + nMatchYMLenMax + 1;
                     
                     if (nMatchFlag == 1)
                     {
                            /* The first Char is [i][u][v] */
                            if (szNextUnit[0] == 'i')
                                   tmp = 1;
                            else if (szNextUnit[0] == 'u')
                                   tmp = 2;
                            else if (szNextUnit[0] == 'v')
                                   tmp = 3;
                                   
                            pnOutPreedit[nOPEOff] = MakeOPE(0, tmp, 0);
                            nOPEOff ++;
                            nCurOff ++;
                     }
                     /*
                     **   A Bug Fixed: ORG: zhonw => zhon w // NEW: zhonw => zh o n w
                     **   97-10-5
                     */
                     else if ( (nMatchFlag == 2) && (tmp1 == nPELen) )
                     {
                            nHalfMatchLen = nMatchSMLen + 1 + nMatchYMLenMax;
                            pnOutPreedit[nOPEOff] = MakeOPE (nHalfMatchLen, 0, 0);
                            nOPEOff ++;
                            for (j = 0; j < (nMatchSMLen + nMatchYMLenMax + 1); j++ )
                            {
                                   pnOutPreedit[nOPEOff] = (int)szNextUnit[j];
                                   nOPEOff ++;
                                   nCurOff ++;
                            }
                     }
                     else if (nMatchFlag == 0)
                     {
                            cEnd = szPreedit[nCurOff + nMatchSMLen + nMatchYMLenFit];
                            cNext = szPreedit[nCurOff + nMatchSMLen + 1 + nMatchYMLenFit];
                            
                            /*
                            ** G[aeou]  //  N[aeiouv]  //  R[aeiou]
                            */
                            if( ((cEnd == 'g') && ((cNext == 'a') || (cNext == 'e') ||     \
                                                 (cNext == 'o') || (cNext == 'u') ))       \
                             || ((cEnd == 'n') && ((cNext == 'a') || (cNext == 'e') ||     \
                                                   (cNext == 'i') || (cNext == 'o') ||     \
                                                   (cNext == 'u') || (cNext == 'v') ))     \
                             || ((cEnd == 'r') && ((cNext == 'a') || (cNext == 'e') ||     \
                                                   (cNext == 'i') || (cNext == 'o') ||     \
                                                   (cNext == 'u') )) )
                            {
                                   for (i = 0; i < (nMatchSMLen + nMatchYMLenFit); i++)
                                          szNextUnit[i] = szPreedit[nCurOff + i];
                                   for (i = (nMatchSMLen + nMatchYMLenFit); i < 7; i++)
                                          szNextUnit[i] = '\0';
                                   
                                   tmp2 = MatchUnitByYinjie (szNextUnit);
                                   nMatchYMLenFit2 = (tmp2 >> 16) & 0x07;
                                   nMatchFlag2 = (tmp2 >> 13) & 0x07;
                                   nMatchSMLen2 = (tmp2 >> 12) & 0x01;
                                   nMatchYMLenMax2 = (tmp2 >> 9) & 0x07;
                                   nMatchYinjie2 = tmp2 & 0x01FF;
                                   
                                   /*
                                   ** The following condition may be adjusted to get more
                                   ** precision and general. Thus, following syntax is equal.
                                   ** eran <==> er'an  ana <==> an'a  IS IT BEST????
                                   */
                                   if (nMatchFlag2 == 0)
                                   {
                                          nMatchYinjie = nMatchYinjie2;
                                          nMatchSMLen = nMatchSMLen2;
                                          nMatchYMLenFit = nMatchYMLenFit2;
                                   }
                            }
                            
                            pnOutPreedit[nOPEOff] = MakeOPE (6, 0, nMatchYinjie);
                            nOPEOff ++;
                            nCurOff += (nMatchSMLen + 1 + nMatchYMLenFit);
                     }
                     else
                     {
                            /* nMatchFlag = 3, or 2 in middle */
                            /* Setting nHalfMatchLen to 6 to avoid MakeOPE(0, 0, 0) */
                            
                            pnOutPreedit[nOPEOff] = MakeOPE (6, 0, nMatchYinjie);
                            nOPEOff ++;
                            nCurOff += (nMatchSMLen + 1 + nMatchYMLenFit);
                     }
              }
                     
       } /* End of While() */
       pnOutPreedit[nOPEOff] = 0;
}

Here is the call graph for this function:

JINT PixWidBetween ( JWORD pwPrsStr,
JINT  nFrom,
JINT  nTo 
)
JINT PixWidBetween_SP ( JWORD pwPrsStr,
JINT  nFrom,
JINT  nTo 
)
JINT PrepareSymbolSge ( SesGuiElement pSge,
JINT  nSymbType 
)
VOID ProcAllKeysym ( JINT pKsThis,
SesGuiElement pSge 
)

Definition at line 109 of file OnKeySym.c.

{
       JINT    i;
       JINT    nKsLen;
       
       nKsLen = 0;
       /* for (i = 0; (i < SUN_NUM_KEYSYM) && (pKsThis[i] != 0x0L); i++) */
       for (i = 0; (i < 1) && (pKsThis[i] != 0x0L); i++)
              nKsLen ++;
       if (nKsLen >= 1) 
       {
              if ((pKsThis[0] == IMXK_Shift_L) || (pKsThis[0] == IMXK_Shift_R))
                     bShiftIsPressed = (JSHORT)(1 - bShiftIsPressed);
              else if (pKsThis[0] == IMXK_Caps_Lock)
                     bCapsIsPressed  = (JSHORT)(1 - bCapsIsPressed);
                     
              else if ((pKsThis[0] == IMXK_Alt_L) ||
                      (pKsThis[0] == IMXK_Alt_L) )
                     bAltIsPressed = (JSHORT)(1 - bAltIsPressed);
                     
              /* The Following Key is used as Switcher of Ime Window */
              else if ((pKsThis[0] == IMXK_Control_L) || 
                      (pKsThis[0] == IMXK_Control_R) )
                     bCtrlIsPressed = (JSHORT)(1 - bCtrlIsPressed);
                     
              else if ((pKsThis[0] == IMXK_Meta_L) ||
                      (pKsThis[0] == IMXK_Meta_R) )
                     bMetaIsPressed = (JSHORT)(1 - bMetaIsPressed);
                     
              else if ((pKsThis[0] == IMSunXK_AltGraph) ||
                      (pKsThis[0] == IMXK_Mode_switch) )
                     bAltGrIsPressed = (JSHORT)(1 - bAltGrIsPressed);
                     
              else if ((pKsThis[0] == IMSunXK_Compose) ||
                      (pKsThis[0] == IMXK_Multi_key) )
                     bCompIsPressed = (JSHORT)(1 - bCompIsPressed);
                     
              /* 
              ** If some other key is combined with the above switcher(s),
              ** These switcher is turn Off and be send as a fully key
              ** to application. (Committed)
              */
              else if ((bCtrlIsPressed == 1 ) || (bMetaIsPressed == 1) ||
                      (bAltGrIsPressed == 1) || (bCompIsPressed == 1))
              {
              }
              
              /*
              ** Alt is used to Switch IM (QuanPin, ShuangPin, WuBi...)
              ** Other combination besides IM switcher is committed out.
              ** To avoid conflict with Application, Alt + 1, 2, 3, 4 is preferred.
              */
              else if (bAltIsPressed == 1)
              {
              }
                     
              /*
              **  Normal single Key is transferred to IM_trans.
              */
              else if ((bShiftIsPressed == 0) && (bCapsIsPressed == 0))
              {
                     if ((pKsThis[0] >= IMXK_A) && (pKsThis[0] <= IMXK_Z))
                            pKsThis[0] += (IMXK_a - IMXK_A);

                     IMPinyinTrans(pKsThis, pSge);  
              }
              
              else if ((bShiftIsPressed == 1) && (bCapsIsPressed == 1))
              {
                     /* Bounce Keyevent directly back application */
                     if ((pKsThis[0] >= IMXK_A) && (pKsThis[0] <= IMXK_Z))
                            pKsThis[0] += (IMXK_a - IMXK_A);
              }
              else if ((bShiftIsPressed == 0) && (bCapsIsPressed == 1))
              {
                     if (nKsLen > 1)
                            pKsThis[0] = pKsThis[1];
              }
              else if ((bShiftIsPressed == 1) && (bCapsIsPressed == 0))
              {
                     if (nKsLen > 1)
                            pKsThis[0] = pKsThis[1];
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

VOID ProcSymbIMKey ( SesGuiElement pSge,
JINT  nSymbType,
JINT pNextKeysym,
ImToXSun pIeh 
)

Definition at line 2595 of file OnKeySym.c.

{
       JWORD  wThisSel[9];
       JINT   i, nCurCandiNum, nChoiceMark, nXrd, nLenThisSel;
       
       GetIehFromSge(pIeh, pSge);
       pIeh->nType = IMXSUN_TYPE_NORMAL;
       memset(pIeh->pwCommit, 0x00, UONE * sizeof(JWORD));
       
       if ((nSymbType != pSge->nKeyLayMode) || (pSge->nKeyLayMode != pSge->nPrevKeyLayMode))
       {
              PrepareSymbolSge(pSge, nSymbType);
              GetIehFromSge(pIeh, pSge);
              
              pIeh->nType = IMXSUN_TYPE_NORMAL;
              pSge->nKeyLayMode     = nSymbType;
              pSge->nPrevKeyLayMode = pSge->nKeyLayMode;
       }
       
       if (IsPageKeysym(pNextKeysym) == TRUE)
       {
              OnPageKeysym(pNextKeysym, pSge);
              GetIehFromSge(pIeh, pSge);
              pIeh->nType = IMXSUN_TYPE_NORMAL;
       }
       else if (IsSelectKeysym(pNextKeysym) == TRUE)
       {
              nCurCandiNum = pSge->nViewCandiEnd - pSge->nViewCandiStart;
              if (pNextKeysym[0] == IMXK_space)
                     pNextKeysym[0] = IMXK_1;
                     
              if ((pNextKeysym[0] > IMXK_0) && (pNextKeysym[0] <= (IMXK_0 + nCurCandiNum)))
              {
                     memset(wThisSel, 0x00, 9 * 2);
                     nChoiceMark     = pNextKeysym[0] - IMXK_0;
                     nXrd            = pSge->nViewCandiStart + nChoiceMark - 1;
                     nLenThisSel     = GetXrdCandi(&(pSge->scSysCandi), &(pSge->ucUdcCandi), nXrd, wThisSel, pSge->nGBKMode);
                     memset(pIeh->pwCommit, 0x00, 256 * 2);
                     assert(nLenThisSel == 1);
                     GetIehFromSge(pIeh, pSge);
                     for (i = 0; i < nLenThisSel; i++)
                            pIeh->pwCommit[i] = wThisSel[i];
                     pIeh->nType = IMXSUN_TYPE_COMMITSYMBOL;
              }
              else
              {
                     NULL;
#ifdef _DRAW_IM_WIN_H
                     XBell (pDspIme, 100);
#endif
              }
       }
       else if ( (IsPageKeysym(pNextKeysym) != TRUE) || (IsSelectKeysym(pNextKeysym) != TRUE) )
       {
              NULL;
#ifdef _DRAW_IM_WIN_H
              XBell (pDspIme, 100);
#endif
       }
       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

JINT QpCaretToPrsCaret ( JWORD pwPrsStr,
JINT  nQpCaret 
)
UCHAR* RecovDyz2244 ( UCHAR szDyz2244)

Definition at line 1972 of file PyBasic.c.

{
       JINT    i, j, nLen, nHlfLen;
       JINT    nDyzCode, nNormCode;
       static  UCHAR*  szNorm = NULL; 
   
       nLen = strlen((CHAR*)szDyz2244);
       nHlfLen = nLen / 2;

       if(szNorm != NULL)
              free(szNorm);

       szNorm = (UCHAR*)malloc(nLen + MALIGN);
       if (szNorm == NULL)
       {
              fprintf(stderr, "Failed to alloc Memory in function RecovDyz2244()\n");
              return (szNorm);
       }
       memset(szNorm, '\0', (nLen + MALIGN));
       
       j = 0;
       for (i = 0; i < nHlfLen; i++)
       {
              nDyzCode = szDyz2244[(2 * i) + 1] + ((JINT)szDyz2244[2 * i] << 8);
              if ((nDyzCode >= 0x2001) && (nDyzCode <= 0x2244))
              {
                     nNormCode         = DYZLIST[nDyzCode - 0x2001];
                     szNorm[2 * i]     = (UCHAR)((nNormCode & 0xFF00) >> 8);
                     szNorm[2 * i + 1] = (UCHAR)(nNormCode & 0x00FF);
              }
              else
              {
                     szNorm[2 * i]      = szDyz2244[2 * i];
                     szNorm[2 * i + 1]  = szDyz2244[2 * i + 1];
              }
       }
       
       return (szNorm);
}
JWORD* RecovDyzNWord2244 ( JWORD pwDyz2244,
JINT  nMaxLen 
)

Definition at line 2032 of file PyBasic.c.

{
       static JWORD*  pwRet = NULL;
       JINT    i;

       free (pwRet);
       pwRet = (JWORD*)malloc((nMaxLen + MALIGN) * sizeof(JWORD));
       if (pwRet == NULL)
       {
              fprintf(stderr, "Failed in malloc() of RecovDyzNWord2244().\n");
              return pwRet;
       }
       memset(pwRet, '\0', sizeof(JWORD) * (nMaxLen + MALIGN));

       for (i = 0; (i < nMaxLen) && (pwDyz2244[i] != 0x0000); i++)
       {
              if ((pwDyz2244[i] >= 0x2001) && (pwDyz2244[i] <= 0x2244))
                     pwRet[i]  = (JWORD)DYZLIST[pwDyz2244[i] - 0x2001];
              else
                     pwRet[i]  = pwDyz2244[i];
       }

       return pwRet;
}
JWORD RecovDyzWord2244 ( JWORD  wDyz2244)

Definition at line 2016 of file PyBasic.c.

{
       JWORD    wRet;
       
       wRet = wDyz2244;
       
       if ((wDyz2244 >= 0x2001) && (wDyz2244 <= 0x2244))
              wRet  = (JWORD)DYZLIST[wDyz2244 - 0x2001];
       
       return wRet;
}
JINT RestoreHzToPy ( SesGuiElement pSge,
JINT  nResFlag 
)
JINT RestoreHzToPy_SP ( SesGuiElement pSge,
JINT  nResFlag 
)
VOID ScrollViewCandiPage ( SysCandi psc,
UdcCandi puc,
SesGuiElement pSge 
)
VOID SpMix2QpMix ( JWORD pwSpMix,
JWORD pwMix,
JINT  nSpCaret,
JINT pnCaret,
JINT  nKeyLayMode 
)
JWORD* StrToJword ( CHAR szStr)

Definition at line 63 of file Jword.c.

{
       JINT    i, nLen;
static  JWORD*  pwRet = NULL;      
       
       nLen = strlen(szStr);
       
       free(pwRet);
       pwRet = (JWORD*)malloc((nLen + MALIGN) * sizeof(JWORD));
       if(pwRet == NULL)
       {
              fprintf (stderr, "Failed to alloc Memory in StrToJword().\n");
              return NULL;
       }
       memset(pwRet, '\0', (nLen + MALIGN) * sizeof(JWORD));

       for (i = 0; i < nLen; i++)
              pwRet[i]  = (JWORD)szStr[i];
       
       return pwRet;
}

Here is the caller graph for this function:

JINT TypeOfSpChar ( CHAR pszOrgSp,
JINT  nPos,
JINT  nKeyLayMode 
)

Definition at line 2435 of file PyBasic.c.

{
       JINT    nLen, i, j, k, m, nRes;
       CHAR    szYjTmp1[10], szYjTmp2[10];
       JINT    nfStartSM, nfStartYM;
       JINT    nKeyLayYM1, nKeyLayYM2, nKeyLaySM;
       
       memset (szYjTmp1, '\0', 10);
       memset (szYjTmp2, '\0', 10);
       nfStartSM = TRUE;
       nfStartYM = FALSE;
       i = j = 0;
       
       nLen = strlen(pszOrgSp);

       if ((nPos < 0) || (nPos >= nLen))
              return SPYJ_INVALID;
              
       /* Valid nPos is  [0 ~ (nLen - 1)] */
       for (i = 0; i <= nPos; )
       {
              if (pszOrgSp[i] == '\'')
              {
                     nfStartSM  = TRUE;
                     nfStartYM  = FALSE;

                     if (nPos == i)
                            return SPYJ_QUOTE;
                     else
                            i++;
                     
                     continue;
              }
              
              if (pszOrgSp[i] == '#')
              {
                     nfStartSM  = TRUE;
                     nfStartYM  = FALSE;

                     if (nPos == i)
                            return SPYJ_NUMSIGN;
                     else
                            i++;
                     
                     continue;
              }
              
              if (pszOrgSp[i] == '$')
              {
                     nfStartSM  = TRUE;
                     nfStartYM  = FALSE;

                     if (nPos == i)
                            return SPYJ_DOLLAR;
                     else
                            i++;
                     
                     continue;
              }

              /* For a UpperCase [A], it was treated as ShengMu and was replaced with ['a'] */
              if (nfStartSM == TRUE)
              {
                     /* To "ch" "sh" "zh" */
                     if ((Lower(pszOrgSp[i]) == 'i') || (Lower(pszOrgSp[i]) == 'u') || (Lower(pszOrgSp[i]) == 'v'))
                     {
                            nKeyLaySM   = KEYLAYMODE[nKeyLayMode][Lower(pszOrgSp[i]) - 'a'] >> 16;
                            szYjTmp1[0] = szYjTmp2[0] = YUNMUSTR[nKeyLaySM][0];
                            szYjTmp1[1] = szYjTmp2[1] = YUNMUSTR[nKeyLaySM][1];
                            szYjTmp1[2] = szYjTmp2[2] = '\0';
                            m = 2;    /* length of ShengMu */
                     }
                     else
                     {
                            szYjTmp1[0] = szYjTmp2[0] = Lower(pszOrgSp[i]);
                            szYjTmp1[1] = szYjTmp2[1] = '\0';
                            m = 1;    /* length of ShengMu */
                     }
                     
                     if (IsUpper(pszOrgSp[i]))
                     {
                            nfStartSM  = TRUE;
                            nfStartYM  = FALSE;
                     }
                     else
                     {
                            nfStartSM  = FALSE;
                            nfStartYM  = TRUE;
                     }

                     if (nPos == i)
                            return SPYJ_SHENGMU;
                     
                     i++;

              }
              else if (nfStartYM == TRUE)
              {
                     /* If it is in Upper Case, treat it as ShengMu */
                     if (IsUpper(pszOrgSp[i]))
                     {
                            nfStartSM  = TRUE;
                            nfStartYM  = FALSE;
                            continue;
                     }
                     
                     nKeyLayYM1 = KEYLAYMODE[nKeyLayMode][pszOrgSp[i] - 'a'] & 0x0000FF;
                     nKeyLayYM2 = (KEYLAYMODE[nKeyLayMode][pszOrgSp[i] - 'a'] & 0x00FF00) >> 8;

                     /* ShengMu just before it is [aeo] */
                     if ((pszOrgSp[i - 1] == 'a') || (pszOrgSp[i - 1] == 'e') || (pszOrgSp[i - 1] == 'o'))
                            szYjTmp1[0]  = szYjTmp2[0] = '\0';

                     strcat(szYjTmp1, YUNMUSTR[nKeyLayYM1]);
                     nRes = FastMatchYinJieStr(szYjTmp1);
                     if ((nRes >= 0) && (nRes < NUM_YINJIE))
                     {
                            if (nPos == i)
                                   return SPYJ_YUNMU;
                            i++;
                     }

                     if ((nRes == -1) && (nKeyLayYM2 != 0))
                     {
                            strcat(szYjTmp2, YUNMUSTR[nKeyLayYM2]);
                            nRes = FastMatchYinJieStr(szYjTmp2);
                            if ((nRes >= 0) && (nRes < NUM_YINJIE))
                            {
                                   if (nPos == i)
                                          return SPYJ_YUNMU;
                                   i++;
                            }
                     }

                     nfStartSM  = TRUE;
                     nfStartYM  = FALSE;
                     memset (szYjTmp1, '\0', 10);
                     memset (szYjTmp2, '\0', 10);
              }
       }
       
       return SPYJ_INVALID;
}

Here is the call graph for this function:

JINT TypeOfSpMixWord ( JWORD pwSpMix,
JINT  nPos,
JINT  nKeyLayMode 
)
JINT YjCodeToYjStr ( JINT  nYjCode,
CHAR szYjStr 
)

Variable Documentation

Definition at line 135 of file NewPY.c.

Definition at line 425 of file KeysymType.c.