⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmichineseinput.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
                while ( data->wszTextBuffer[j] )
                {
                    current_pixel = get_CharWidth(data->wszTextBuffer[j]);
                    current_x += current_pixel;

                    /* 2003/10/28 sunsj modify the line width */
                    if ( current_x>112 )
                    {
                        current_y += 16;
                        current_x = current_pixel;
                    }
                    if ( current_y > FIFTH_LINE )
                    {
                        Temp_ptr = data->wszTextBuffer;
                        Temp_ptr = Temp_ptr + j;
                        current_y = 0;
                        conver_page = TRUE;
                    }
                    j++;
                }
                UnicodeConver(data->wszTextBuffer, data->wszTextBuffer);

                if ( conver_page == FALSE )
                {
                    if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                    {
                        dspl_TextOut(4,FIRST_LINE,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                    }
                    else
                    {
                        dspl_TextOut(4,FIRST_LINE,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        TextCursorDisplayContorl(&data->Ime, data->CursorPosition, 0);
                    }
                }
                else
                {
                    dspl_TextOut(4, FIRST_LINE, DSPL_TXTATTR_UNICODE, (char *)Temp_ptr);
                }
#if 0
                if ( data->Ime.TextBufferCount <=CANDIDATES_PER_GROUP )  //check text buffer count
                {
                    if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                    {
                        dspl_TextOut(1,0,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                    }
                    else
                    {
                        dspl_TextOut(1,0,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        TextCursorDisplayContorl(&data->Ime, data->CursorPosition, 0);
                    }
                }
                else //when data->Ime.TextBufferCount > CANDIDATES_PER_GROUP
                {
                    if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                    {
                        Temp_ptr = data->wszTextBuffer;
                        Temp_ptr = Temp_ptr + data->Ime.TextBufferCount - CANDIDATES_PER_GROUP;
                        dspl_TextOut(1,0,DSPL_TXTATTR_UNICODE,(char *)Temp_ptr);
                    }
                    else if ( data->Ime.TextCursor < CANDIDATES_PER_GROUP )
                    {
                        dspl_TextOut(1,0,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        TextCursorDisplayContorl(&data->Ime, data->CursorPosition, 0);
                    }
                    else
                    {
                        Temp_ptr = &data->wszTextBuffer[data->Ime.TextCursor] - CANDIDATES_PER_GROUP + 1;
                        dspl_TextOut(1,0,DSPL_TXTATTR_UNICODE,(char *)Temp_ptr);
                        dspl_TextOut(73,0,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_INVERS,(char*)data->CursorPosition);
                    }
                }
                dspl_TextOut(0,Mmi_layout_first_line(),DSPL_TXTATTR_UNICODE,(char*)StrokePrompt);   /* Display input prompt */
#endif
                dspl_colorTextOut(0,0,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_TRANSPARENT,(char*)StrokePrompt,0xffffff);   /* Display input prompt */ //sunsjtest
                /* 2003/10/26 sunsj add for stroke element display */
                dspl_TextOut(1,SIXTH_LINE,DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);

                /* Display candidate charaters returned from eZiText */
                dspl_TextOut(3,SEVENTH_LINE,DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
                dspl_DrawRect(0, 98, 119, 130);
                /* Highlight the candidate character pointed by Ime.CandidateCursor */
                CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);
                /* 2003/11/27 sunsj */
                displaySoftKeys(TxtSoftOK,TxtDelete);   /* Softkey display*/
#if(MAIN_LCD_SIZE==3)
				draw_softkeybar_fourdirection_arrow();//jhxu720 add
#endif
				//displaySoftKeys(TxtSoftSelect,TxtSoftOK);   /* Softkey display*/
#if 0
                /* Display input sequence for stroke */
                i = Uni_strlen(data->DisplayElementBuffer);
                if ( i <= 4 )
                {
                    dspl_TextOut(36,Mmi_layout_first_line(),DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);//data->wszElementBuffer);
                }
                else
                {
                    Temp_ptr = data->DisplayElementBuffer;
                    Temp_ptr = Temp_ptr + i - 4;
                    dspl_TextOut(36,Mmi_layout_first_line(),DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
                }
                /* Display candidate charaters returned from eZiText */
                dspl_TextOut(1,Mmi_layout_second_line(),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
                /* Highlight the candidate character pointed by Ime.CandidateCursor */
                CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);
                displaySoftKeys(TxtSoftSelect,TxtSoftOK);   /* Softkey display*/
#endif
                break;
            case PINYIN_INPUT_SCREEN:
                {
                    /* 2003/10/13 sunsj modify the display of input pinyin */
                    /* Display the correct portion composed text stored in wszTextBuffer. If the text cursor is not pointing at */
                    /* the end of the text buffer, the display content is then adjusted to display the correct portion of the   */
                    /* text buffer.																				  */
                    //if ( data->Ime.TextBufferCount <=CANDIDATES_PER_GROUP )  //check text buffer count
                    current_x = 0;
                    current_y = FIRST_LINE;
                    conver_page = FALSE;
                    j=0;
                    UnicodeConver(data->wszTextBuffer, data->wszTextBuffer);
                    while ( data->wszTextBuffer[j] )
                    {
                        current_pixel = get_CharWidth(data->wszTextBuffer[j]);
                        current_x += current_pixel;

                        /* 2003/12/01 sunsj modify the line width */
                        if ( current_x>115 )
                        {
                            current_y += 16;
                            current_x = current_pixel;
                        }
                        if ( current_y > FIFTH_LINE )
                        {
                            Temp_ptr = data->wszTextBuffer;
                            Temp_ptr = Temp_ptr + j;
                            current_y = 0;
                            conver_page = TRUE;
                        }
                        j++;
                    }
                    UnicodeConver(data->wszTextBuffer, data->wszTextBuffer);

                    if ( conver_page == FALSE )
                    {
                        if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                        {
							/* 2003/12/01 sunsj modify lcd width */
                            dspl_TextOut_Blk(4,FIRST_LINE, 115, DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        }
                        else
                        {
							/* 2003/12/01 sunsj modify lcd width */
                            dspl_TextOut_Blk(4,FIRST_LINE, 115, DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                            TextCursorDisplayContorl(&data->Ime, data->CursorPosition, 0);
                        }
                    }
                    else
                    {
						/* 2003/12/01 sunsj modify lcd width */
                        dspl_TextOut_Blk(4, FIRST_LINE, 115, DSPL_TXTATTR_UNICODE, (char *)Temp_ptr);
                    }
					drawcolorclarity(102, 1 ,spareNum, 0xffffff);
                    /* 2003/10/13 sunsj/ modify pinyin input method display */
                    /*else if( data->Ime.TextBufferCount <= CANDIDATES_PER_GROUP*2 )//when data->Ime.TextBufferCount > CANDIDATES_PER_GROUP
                    {
                        Temp_ptr = data->wszTextBuffer;
                        Temp_ptr = Temp_ptr + CANDIDATES_PER_GROUP;
                        dspl_TextOut(4,FIRST_LINE,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        dspl_TextOut(4, SECOND_LINE, DSPL_TXTATTR_UNICODE, (char *)Temp_ptr);
                    }*/
                    /*{
                        if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                        {
                            Temp_ptr = data->wszTextBuffer;
                            Temp_ptr = Temp_ptr + data->Ime.TextBufferCount - CANDIDATES_PER_GROUP;
                            dspl_TextOut(1,FIRST_LINE,DSPL_TXTATTR_UNICODE,(char *)Temp_ptr);
                        }
                        else if ( data->Ime.TextCursor < CANDIDATES_PER_GROUP )
                        {
                            dspl_TextOut(1,FIRST_LINE,DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                            TextCursorDisplayContorl(&data->Ime, data->CursorPosition, 0);
                        }
                        else
                        {
                            Temp_ptr = &data->wszTextBuffer[data->Ime.TextCursor] - CANDIDATES_PER_GROUP + 1;
                            dspl_TextOut(1,	FIRST_LINE,DSPL_TXTATTR_UNICODE,(char *)Temp_ptr);
                            dspl_TextOut(73,0,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_INVERS,(char*)data->CursorPosition);
                        }
                    }*/
                    dspl_colorTextOut(0,0,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_TRANSPARENT,(char*)PinYinPrompt,0xffffff);   /* Display input prompt */ //sunsjtest

                    /* 2003/10/13 sunsj/ Display input sequence for Pin-yin input */
                    i = data->Ime.PinyinElementBUF[data->Ime.ElementNumber-1].Count;
                    dspl_Clear(0, FIFTH_LINE, 120, SEVENTH_LINE);
                    for ( j=0; j < ELEMENT_PERPAGE; j++ )
                    {
                        memset( &data->Ime.PinyinDisplayBuf[j], 0x0000, TEXT_BUFFER_EXTRA_SPACE+1);
                    }

                    if ( data->Ime.Element_Select < ELEMENT_PERPAGE )
                    {
                        for ( j=0; j<ELEMENT_PERPAGE; j++ )
                        {
                            UnicodeConver((USHORT*)&data->Ime.PinyinElementBUF[data->Ime.ElementNumber-1].PinyinEleBUF[j],(USHORT*)&data->Ime.PinyinDisplayBuf[j]);
                        }
                    }
                    else
                    {
                        UnicodeConver((USHORT*)&data->Ime.PinyinElementBUF[data->Ime.ElementNumber-1].PinyinEleBUF[4],(USHORT*)&data->Ime.PinyinDisplayBuf[0]);
                        UnicodeConver((USHORT*)&data->Ime.PinyinElementBUF[data->Ime.ElementNumber-1].PinyinEleBUF[5],(USHORT*)&data->Ime.PinyinDisplayBuf[1]);
                    }
                    //if ( i <= 4 )
                    {
                        dspl_TextOut(1,FIFTH_LINE,DSPL_TXTATTR_UNICODE,(char*)&data->Ime.PinyinDisplayBuf[0]);//data->wszElementBuffer);
                        dspl_TextOut(61,FIFTH_LINE,DSPL_TXTATTR_UNICODE,(char*)&data->Ime.PinyinDisplayBuf[1]);//data->wszElementBuffer);
                        dspl_TextOut(1,SIXTH_LINE,DSPL_TXTATTR_UNICODE,(char*)&data->Ime.PinyinDisplayBuf[2]);//data->wszElementBuffer);
                        dspl_TextOut(61,SIXTH_LINE,DSPL_TXTATTR_UNICODE,(char*)&data->Ime.PinyinDisplayBuf[3]);//data->wszElementBuffer);
                    }
                    /*else
                    {
                        Temp_ptr = data->DisplayElementBuffer;
                        Temp_ptr = Temp_ptr + i - 4;
                        dspl_TextOut(1,SIXTH_LINE,DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
                    }*/
                    ElementHighlightDisplayContorl(&data->Ime);

                    /* Display candidate charaters returned from eZiText */
                    dspl_TextOut(3,SEVENTH_LINE,DSPL_TXTATTR_UNICODE|DSPL_TXTATTR_SIGNED_COORDS,(char*)data->wcCandidates);
                    dspl_DrawRect(0, 82, 119, 130);
                    /* Highlight the candidate character pointed by Ime.CandidateCursor */
                    CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);

                    /* 2003/11/27 sunsj */
					displaySoftKeys(TxtSoftOK,TxtDelete);   /* Softkey display*/
#if(MAIN_LCD_SIZE==3)
					draw_softkeybar_fourdirection_arrow();//jhxu720 add
#endif
                    //displaySoftKeys(TxtSoftSelect,TxtSoftOK);   /* Softkey display*/
                }
                break;
            case WORD_ASSOCIATION_SCREEN:
                {
                    /* Display the correct portion composed text stored in wszTextBuffer. If the text cursor is not pointing at */
                    /* the end of the text buffer, the display content is then adjusted to display the correct portion of the   */
                    /* text buffer.																				  */
                    //if ( data->Ime.TextBufferCount <=CANDIDATES_PER_GROUP )  //check text buffer count
                    current_x = 0;
                    current_y = FIRST_LINE;
                    conver_page = FALSE;
                    j=0;
                    UnicodeConver(data->wszTextBuffer, data->wszTextBuffer);
                    while ( data->wszTextBuffer[j] )
                    {
                        current_pixel = get_CharWidth(data->wszTextBuffer[j]);
                        current_x += current_pixel;

                        /* 2003/12/01 sunsj modify the line width */
                        if ( current_x>115 )
                        {
                            current_y += 16;
                            current_x = current_pixel;
                        }
                        if ( current_y > FIFTH_LINE )
                        {
                            Temp_ptr = data->wszTextBuffer;
                            Temp_ptr = Temp_ptr + j;
                            current_y = 0;
                            conver_page = TRUE;
                        }
                        j++;
                    }
                    UnicodeConver(data->wszTextBuffer, data->wszTextBuffer);

                    if ( conver_page == FALSE )
                    {
                        if ( data->Ime.TextBufferCount == data->Ime.TextCursor )
                        {
							/* 2003/12/01 sunsj modify lcd width */
                            dspl_TextOut_Blk(4,FIRST_LINE, 115, DSPL_TXTATTR_UNICODE,(char*)data->wszTextBuffer);
                        }
                        else
                        {
							/* 2003/12/01 sunsj modify lcd width */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -