📄 mmichineseinput.c
字号:
{
data->StartOfDisplayIndex = data->StartOfDisplayIndex + CANDIDATES_PER_GROUP;
}
for(i=0; i<CANDIDATES_PER_GROUP; i++)
TempArray[i]= data->wszTextBuffer[data->StartOfDisplayIndex+ i];
TempArray[CANDIDATES_PER_GROUP] = 0x0000;
dspl_TextOut(1,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char *)TempArray);
for(i=0; i<CANDIDATES_PER_GROUP; i++)
TempArray2[i]= data->wszTextBuffer[data->StartOfDisplayIndex+ i +CANDIDATES_PER_GROUP];
TempArray2[CANDIDATES_PER_GROUP] = 0x0000;
dspl_TextOut(1,Mmi_layout_line(2),DSPL_TXTATTR_UNICODE,(char *)TempArray2);
if((data->Ime.TextCursor - data->StartOfDisplayIndex) < CANDIDATES_PER_GROUP)
j = 1;
else if((data->Ime.TextCursor - data->StartOfDisplayIndex) < CANDIDATES_PER_GROUP * 2)
j = 2;
TextCursorDisplayContorl(&data->Ime, data->CursorPosition, j);
}
else if(data->Ime.TextCursor < data->StartOfDisplayIndex && data->StartOfDisplayIndex != 0)
{
data->StartOfDisplayIndex = data->StartOfDisplayIndex - CANDIDATES_PER_GROUP;
for(i=0; i<CANDIDATES_PER_GROUP; i++)
TempArray[i]= data->wszTextBuffer[data->StartOfDisplayIndex+ i ];
TempArray[CANDIDATES_PER_GROUP] = 0x0000;
dspl_TextOut(1,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char *)TempArray);
for(i=0; i<CANDIDATES_PER_GROUP; i++)
TempArray2[i]= data->wszTextBuffer[data->StartOfDisplayIndex+ i +CANDIDATES_PER_GROUP];
TempArray2[CANDIDATES_PER_GROUP] = 0x0000;
dspl_TextOut(1,Mmi_layout_line(2),DSPL_TXTATTR_UNICODE,(char *)TempArray2);
if((data->Ime.TextCursor - data->StartOfDisplayIndex) < CANDIDATES_PER_GROUP)
j = 1;
else if((data->Ime.TextCursor - data->StartOfDisplayIndex) < CANDIDATES_PER_GROUP * 2)
j = 2;
TextCursorDisplayContorl(&data->Ime, data->CursorPosition, j);
}
displaySoftKeys(data->Callback_Data.LeftSoftKey,TxtDelete); /* Softkey display*/
}
}
#else /*SPR 1319, show editor and softkeys*/
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
ATB_edit_Unhide(data->editor);
ATB_edit_Show(data->editor);
#else /* NEW_EDITOR */
edtUnhide(data->editor);
edtShow(data->editor);
#endif /* NEW_EDITOR */
displaySoftKeys(data->Callback_Data.LeftSoftKey,TxtDelete);
#endif
}
break;
case STROKE_INPUT_SCREEN:
#ifndef LSCREEN
/* 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
{
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);
}
}
#else /*SPR 1319, show editor*/
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
ATB_edit_Unhide(data->editor);
ATB_edit_Show(data->editor);
#else /* NEW_EDITOR */
edtUnhide(data->editor);
edtShow(data->editor);
#endif /* NEW_EDITOR */
#endif
#ifndef LSCREEN
dspl_TextOut(0,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)StrokePrompt);/* Display input prompt */
#else
/*SPR 1319 show stroke prompt*/
dspl_TextOut(0,SCREEN_SIZE_Y-Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)StrokePrompt);/* Display input prompt */
#endif
/* Display input sequence for stroke */
i = Uni_strlen(data->DisplayElementBuffer);
if( i <= 4)
{
#ifndef LSCREEN
dspl_TextOut(CHI_FONT_WIDTH*3,Mmi_layout_line(2),DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);//data->wszElementBuffer);
#else
/*mc SPR1319*/
dspl_TextOut(CHI_FONT_WIDTH*3,SCREEN_SIZE_Y- Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);//data->wszElementBuffer);
#endif
}
else
{
Temp_ptr = data->DisplayElementBuffer;
Temp_ptr = Temp_ptr + i - 4;
#ifndef LSCREEN
dspl_TextOut(CHI_FONT_WIDTH*3,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
#else
/*mc SPR1319*/
dspl_TextOut(CHI_FONT_WIDTH*3,SCREEN_SIZE_Y-Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
#endif
}
#ifndef LSCREEN
/* Display candidate characters returned from eZiText */
dspl_TextOut(1,Mmi_layout_line(2),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#else
/*mc SPR1319*/
dspl_TextOut(1,SCREEN_SIZE_Y-Mmi_layout_line(3),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#endif
/* Highlight the candidate character pointed by Ime.CandidateCursor */
CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);
if (Uni_strlen(data->DisplayElementBuffer) > 0)
displaySoftKeys(TxtSoftSelect,TxtDelete); /* Softkey display*/
else
displaySoftKeys(TxtSoftSelect,TxtSoftOK); /* Softkey display*/
break;
case PINYIN_INPUT_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.
*/
#ifndef LSCREEN
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);
}
}
#else
/*mc SPR1319*/
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
ATB_edit_Unhide(data->editor);
ATB_edit_Show(data->editor);
#else /* NEW_EDITOR */
edtUnhide(data->editor);
edtShow(data->editor);
#endif /* NEW_EDITOR */
#endif
#ifndef LSCREEN
dspl_TextOut(0,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)PinYinPrompt);/* Display input prompt */
#else
/*mc SPR1319*/
dspl_TextOut(0,SCREEN_SIZE_Y - Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)PinYinPrompt);/* Display input prompt */
#endif
/* Display input sequence for Pin-yin input */
i = Uni_strlen(data->DisplayElementBuffer);
if( i <= 4)
{
#ifndef LSCREEN
dspl_TextOut(CHI_FONT_WIDTH*3,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);//data->wszElementBuffer);
#else
/*mc SPR1319*/
dspl_TextOut(CHI_FONT_WIDTH*3,SCREEN_SIZE_Y-Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)data->DisplayElementBuffer);//data->wszElementBuffer);
#endif
}
else
{
Temp_ptr = data->DisplayElementBuffer;
Temp_ptr = Temp_ptr + i - 4;
#ifndef LSCREEN
dspl_TextOut(CHI_FONT_WIDTH*3,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
#else
/*mc SPR1319*/
dspl_TextOut(CHI_FONT_WIDTH*3,SCREEN_SIZE_Y -Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)Temp_ptr);//data->wszElementBuffer);
#endif
}
/* Display candidate characters returned from eZiText */
#ifndef LSCREEN
dspl_TextOut(1,Mmi_layout_second_line(),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#else
/*mc SPR1319*/
dspl_TextOut(1,SCREEN_SIZE_Y-Mmi_layout_line(3),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#endif
/* Highlight the candidate character pointed by Ime.CandidateCursor */
CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);
/*MC should have "Delete" softkey when entering pinyin letters*/
if (Uni_strlen(data->DisplayElementBuffer) > 0)
displaySoftKeys(TxtSoftSelect,TxtDelete); /* Softkey display*/
else
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.
*/
#ifndef LSCREEN
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);
}
}
#else
/*mc SPR1319*/
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
ATB_edit_Unhide(data->editor);
ATB_edit_Show(data->editor);
#else /* NEW_EDITOR */
edtUnhide(data->editor);
edtShow(data->editor);
#endif /* NEW_EDITOR */
#endif
if(data->Ime.EditorMode == STROKE_INPUT_MODE)
{
#ifndef LSCREEN
dspl_TextOut(0,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)StrokePrompt); /* Display input prompt */
/* Display input sequence for stroke */
#else
/*mc SPR1319*/
dspl_TextOut(0,SCREEN_SIZE_Y -Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)StrokePrompt); /* Display input prompt */
/* Display input sequence for stroke */
#endif
}
else if(data->Ime.EditorMode == PINYIN_INPUT_MODE)
{
#ifndef LSCREEN
dspl_TextOut(0,Mmi_layout_line(1),DSPL_TXTATTR_UNICODE,(char*)PinYinPrompt); /* Display input prompt */
/* Display input sequence for Pin-yin input */
#else
dspl_TextOut(0,SCREEN_SIZE_Y-Mmi_layout_line(4),DSPL_TXTATTR_UNICODE,(char*)PinYinPrompt); /* Display input prompt */
/* Display input sequence for Pin-yin input */
#endif
}
#ifndef LSCREEN
/* Display candidate charaters returned from eZiText */
dspl_TextOut(1,Mmi_layout_line(2),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#else
dspl_TextOut(1,SCREEN_SIZE_Y-Mmi_layout_line(3),DSPL_TXTATTR_UNICODE,(char*)data->wcCandidates);
#endif
/* Highlight the candidate character pointed by Ime.CandidateCursor */
CandidateHighlightDisplayContorl(&data->Ime, data->HighlightedCandidate);
displaySoftKeys(TxtSoftSelect,TxtSoftOK); /* Softkey display*/
break;
default:
break;
}
}
break;
default:
return 0;
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -