T9 & AUTOMATA 2007. 3. 23 PLATFORM TEAM 정용학
차례 T9 개요 새로운언어 (LDB) 추가 T9 주요구조체 / 주요함수 Automata 개요 Automata 주요함수 추후세미나계획 질의응답및토의 T9 ( 2 / 30 )
T9 개요 일반적으로 cat 이라는단어를쓸려면... 기존모드 (multitap) 2,2,2, 2,8 ( 총 6번의입력 ) T9 모드 (ambiguous) 2,2,8 ( 총 3 번의입력 ) T9 ( 3 / 30 )
T9 개요 Control Keys Clear Key Next key (NUM_KEY 0) Navigational keys Text-Entry Keys Smart Punctuation key (NUM_KEY 1) Alphanumeric keys (NUM_KEY 2 ~ 9) Space key ( # key) Shift Key (* key) ENG, Eng, eng T9 ( 4 / 30 )
새로운언어 (LDB) 추가 준비물 LDB 파일 T9viewldb.exe ldbmerge.pl ads12.bat T9 ( 5 / 30 )
새로운언어 (LDB) 추가 LDB 정보보기 사용법 : CMD 창에서 T9viewldb 파일명 T9 ( 6 / 30 )
새로운언어 (LDB) 추가 ads12 Perl 명령사용하기위하여사용법 : CMD 창에서 ads12 LDB MERGE 사용법 : CMD 창에서 perl ldbmerge.pl -k 15 파일명 T9 ( 7 / 30 )
새로운언어 (LDB) 추가 생성파일확인 t9gen.c t9lang.c 각언어의 ID T9 ( 8 / 30 )
새로운언어 (LDB) 추가 해당디렉토리에생성된파일옮김 UMP\HAL\AUTOMATA T9 ( 9 / 30 )
T9 주요구조체 T9FieldInfo T9 에관한모든정보를가진구조체 typedef struct T9FieldInfo_s T9SYMB *pstxtbuf; T9AuxType *paauxbuf; T9UINT nbuflenmax; T9UINT nbuflen; T9UINT ncursor; T9UINT nwordlen; T9UINT ncompllen; T9UINT nldbnum; T9U8 bsymbolclass; T9UINT ncurselobj; T9U32 dwstatebits; T9U8 bnumsuppllangs; T9U8 bactivelangindex; T9U8 bautoswitchlangindex; T9LdbInfo pldb[1 + T9MAXBACKUPLANGS]; T9HandleRequest_f T9HandleRequest; T9ReadLdbData_f T9ReadLdbData; T9ConvertChar_f T9ConvertChar; void *poemprivate; T9U32 dwreserved; T9U8 pbcache[t9cachesize]; #ifdef T9EVENTAPI T9_upAuxAPI ulangdata; #endif struct T9_PrivateNotLdb_s T9Private; struct T9_PrivateLdb_s T9PrivateLdb[1 + T9MAXBACKUPLANGS]; T9FieldInfo; T9 ( 10 / 30 )
T9 주요함수 T9ReadLdbData 데이터읽기를요청할때읽을 LDB 영역을결정 T9U32 T9FARCALL T9ReadLdbData(T9FieldInfo *pfieldinfo, T9U32 dwoffset, T9FARPOINTER *ppbdst, T9U32 *pdwstart, T9UINT nsize, T9MINOR mcacheindex) switch (pfieldinfo->nldbnum) case ( 1 * 256) + 9 : /* English 0109 */ if (dwoffset < 15360) *ppbdst = (T9FARPOINTER) l0109b00; else if (dwoffset < 30720) *ppbdst = (T9FARPOINTER) l0109b01; else if (dwoffset < 35999) *ppbdst = (T9FARPOINTER) l0109b02; nsize = 5279; else nsize = 0; /* Invalid offset into database! */ break; case ( 1 * 256) + 13 : /* Hebrew * 0113/ if (dwoffset < 15360) *ppbdst = (T9FARPOINTER) l0113b00; else if (dwoffset < 30720) *ppbdst = (T9FARPOINTER) l0113b01;... else if (dwoffset < 130208) *ppbdst = (T9FARPOINTER) l0113b08; nsize = 7328; else nsize = 0; /* Invalid offset into database! */ break; T9 ( 11 / 30 )
T9 주요함수 T9HandleEvent 들어오는 Event Type 에따라서함수를호출 LDB ID에따라서언어를설정 T9HandleEvent(T9AWFieldInfo *pawfieldinfo, T9Event *pevent) T9ConvertChar 228을눌렀을경우 : Bat, Cat, Act, Abu, Cau, Cav, Acu, Bau 총 8개가나옴 0번키를누르면이함수가호출이되어서 8개의문자가변화면서저장됨 T9 ( 12 / 30 )
AUTOMATA 개요 Automata Automaton의복수로자동장치, 자동로봇이란뜻사용자의입력에따라자동으로 Text를만들어주는장치 ezi, 한돌, T9 등등 Automata 함수 Automata_Function_Type 안에함수포인터로사용자가원하는 Automata 함수로연결되어있음 UMP_F_automata_xxx() - 19개 UMP_H_automata_xxx_t9() t9의시작 UMP_H_automata_start_t9() 이벤트처리 UMP_H_automata_event_t9() t9의끝 UMP_H_automata_end_t9() T9 ( 13 / 30 )
AUTOMATA 주요함수 UZoneKey_To_T9Key key event 를 T9 key event 로변환해줌 T9KEY UZoneKey_To_T9Key(dword ckey) T9U8 i; for (i = 0; i < UZONE_T9_KEY_TABLE_SIZE ; ++i) if (UZone_T9_Key_Table[i].cKey == ckey) return UZone_T9_Key_Table[i].mKey; return T9KEYNONE; T9 ( 14 / 30 )
AUTOMATA 주요함수 UMP_H_automata_get_symbol_t9 UMP_Return_Type UMP_H_automata_get_symbol_t9(UZ_CHAR * symbol_buf, word max_symbol_buf_len) if(max_symbol_buf_len > SELECTION_BUFFER_SIZE) UZ_MEMCPY(symbol_buf, strsymbs[symb_line], SELECTION_BUFFER_SIZE); symbol_buf[selection_buffer_size] = NULL; else UZ_MEMCPY(symbol_buf, strsymbs[symb_line], max_symbol_buf_len - 1); symbol_buf[max_symbol_buf_len - 1] = NULL; static UZ_CHAR const strsymbs[symbols_line_max][selection_buffer_size] = '.', ',', '-', '!', '?', '@', '(', ')', ':', '&', '\'', '\"', '\\', '/', '_', '[', ']', ';', '$', '%', '+', '*', '=', '~', '<', '>', '#', ' ', '`', '^', '', '', ' ', ' ', ' ', ' ' ; T9 ( 15 / 30 )
AUTOMATA 주요함수 UMP_H_automata_set_cursor_t9 UMP_Return_Type UMP_H_automata_set_cursor_t9(word cursor) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; T9WASetCursor(cursor); UMP_H_automata_get_cursor_t9 UMP_Return_Type UMP_H_automata_get_cursor_t9(word * cursor) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; *cursor = T9WAGetCursor(); T9 ( 16 / 30 )
AUTOMATA 주요함수 UMP_H_automata_set_word_len_t9 UMP_Return_Type UMP_H_automata_set_word_len_t9(word word_len) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; T9WASetWordLen(word_len); UMP_H_automata_get_word_len_t9 UMP_Return_Type UMP_H_automata_get_word_len_t9(word * word_len) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; *word_len = T9WAGetWordLen(); T9 ( 17 / 30 )
AUTOMATA 주요함수 UMP_H_automata_timeout_t9 UMP_Return_Type UMP_H_automata_timeout_t9() if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; T9WAPITimeout(1); UMP_H_automata_get_insert_mode_t9 UMP_Return_Type UMP_H_automata_get_insert_mode_t9(boolean * insert_mode) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; *insert_mode = T9WAGetInsertMode(); T9 ( 18 / 30 )
AUTOMATA 주요함수 UMP_H_automata_set_cap_state_t9 UMP_Return_Type UMP_H_automata_set_cap_state_t9(automate_alpha_cap_mode_type cap_state) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; if (cap_state == AUTOMATA_CAP_eng_MODE) T9WAHandleCtrlEvent(T9CTRLCLRCAP); else if (cap_state == AUTOMATA_CAP_Eng_MODE) T9WAHandleCtrlEvent(T9CTRLSETSHF); else if (cap_state == AUTOMATA_CAP_ENG_MODE) T9WAHandleCtrlEvent(T9CTRLSETCAP); T9 ( 19 / 30 )
AUTOMATA 주요함수 UMP_H_automata_get_cap_state_t9 UMP_Return_Type UMP_H_automata_get_cap_state_t9(automate_alpha_cap_mode_type * cap_state) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; if (T9WAGetShiftMode()) *cap_state = AUTOMATA_CAP_Eng_MODE; else if (T9WAGetCaplockMode()) *cap_state = AUTOMATA_CAP_ENG_MODE; else *cap_state = AUTOMATA_CAP_eng_MODE; T9 ( 20 / 30 )
AUTOMATA 주요함수 UMP_H_automata_get_multitap_mode_t9 UMP_Return_Type UMP_H_automata_get_multitap_mode_t9(boolean * multitap_mode) if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; *multitap_mode = T9WAGetMultitapMode(); UMP_H_automata_clear_text_t9 UMP_Return_Type UMP_H_automata_clear_text_t9() if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; T9WAClrBuffer(); T9 ( 21 / 30 )
AUTOMATA 주요함수 UMP_H_automata_get_text_t9 UMP_Return_Type UMP_H_automata_get_text_t9(UZ_BYTE * buf, word max_len, word *buf_len) T9WAGetText((T9SYMB *)buf, (T9UINT *)buf_len); buf[*buf_len] = 0; UMP_H_automata_set_text_t9 UMP_Return_Type UMP_H_automata_set_text_t9(UZ_BYTE * buf, word buf_len) if(0 == buf_len) T9WAClrBuffer(); else T9WASetText((T9SYMB *)buf, (T9UINT)buf_len); T9 ( 22 / 30 )
AUTOMATA 주요함수 UMP_H_automata_change_mode_t9 UMP_Return_Type UMP_H_automata_change_mode_t9(byte automata_mode) symb_line = 0; switch(automata_mode) case AUTOMATA_ALPHA_MODE: if(t9statnone == SetLanguage(PLDBID_English, 0)) if(t9statnone == T9WSetMode(T9WAWMULTITAP)) break; case AUTOMATA_T9_ALPHA_MODE: if(t9statnone == SetLanguage(PLDBID_English, 0)) if(t9statnone == T9WSetMode(T9WAWAMBIG)) break; case AUTOMATA_NUMBER_MODE: case AUTOMATA_SYMBOL_MODE: if(t9statnone == T9WSetMode(T9WAWMULTITAP))... T9 ( 23 / 30 )
AUTOMATA 주요함수 UMP_H_automata_start_t9 UMP_Return_Type UMP_H_automata_start_t9(word max_buf_len) if( IsRunning == TRUE) return UMP_R_AUTOMATA_RUNNING; UDB_BUFF = (T9AWUdbInfo *)UMP_F_MEMORY_malloc(UDB_SIZE * sizeof(t9awudbinfo)); if (UDB_BUFF == NULL) ASSERT(UDB_BUFF == NULL); return UMP_R_MEMORY_ALLOC_FAIL; if( T9Init(T9PIDEnglish, UDB_BUFF, UDB_SIZE) ) if(max_buffer_length < max_buf_len) return UMP_R_FAIL; T9WASetMaxBufLen(max_buf_len); IsRunning = TRUE; T9WSetMode(T9WAWMULTITAP); return UMP_R_FAIL; T9 ( 24 / 30 )
AUTOMATA 주요함수 UMP_H_automata_end_t9 UMP_Return_Type UMP_H_automata_end_t9() if(isrunning == FALSE) return UMP_R_AUTOMATA_NOT_START; T9Terminate(); IsRunning = FALSE; UMP_F_MEMORY_free(UDB_BUFF); UDB_BUFF = NULL; T9 ( 25 / 30 )
AUTOMATA 주요함수 UMP_H_automata_event_t9 UMP_Return_Type UMP_H_automata_event_t9(dword event, UZ_BYTE * buf, word max_len, word * buf_len, word * word_len, word * cursor, byte * insert_mode, byte * multitap_mode, byte automata_mode) T9KEY curkey = UZoneKey_To_T9Key(event); T9UINT nstatus = T9ERR_NONE; switch(automata_mode) case AUTOMATA_T9_ALPHA_MODE: case AUTOMATA_T9_HEBREW_MODE: case AUTOMATA_T9_RUSSIAN_MODE: if(t9keyambiga == curkey) nstatus = T9WAHandleEvent(T9KEYNEXT); break; case AUTOMATA_ALPHA_MODE: case AUTOMATA_HEBREW_MODE: case AUTOMATA_RUSSIAN_MODE: T9 ( 26 / 30 )
switch(curkey) case T9ADDKEY: nstatus = T9AddKey(curKey); AUTOMATA 주요함수 break; default: nstatus = T9WAHandleEvent(curKey); break; break; case AUTOMATA_NUMBER_MODE: if( (curkey >= T9KEYAMBIG1) && (curkey <= T9KEYAMBIGA) ) T9WAAddExplicitChar((T9SYMB)event); else nstatus = T9WAHandleEvent(curKey); break; case AUTOMATA_SYMBOL_MODE: if(t9keyambige == curkey) if(0 < symb_line) --symb_line; else symb_line = SYMBOLS_LINE_MAX - 1; T9 ( 27 / 30 )
AUTOMATA 주요함수 else if(t9keyambigf == curkey) if(symbols_line_max - 1 > symb_line) ++symb_line; else symb_line = 0; else if( (curkey >= T9KEYAMBIG1) && (curkey <= T9KEYAMBIGA) ) if( (T9KEYAMBIGA == curkey) ((SYMBOLS_LINE_MAX - 1 == symb_line) && (SELECTION_BUFFER_SIZE - 4 <= (curkey - T9KEYAMBIG1))) ) T9WAAddExplicitChar(strSymbs[symb_line][(curKey - T9KEYAMBIG1)]); else nstatus = T9WAHandleEvent(curKey); break; default: return UMP_R_NOT_SUPPORT; UMP_H_automata_get_text_t9(buf, max_len, buf_len); UMP_H_automata_get_cursor_t9(cursor); UMP_H_automata_get_word_len_t9(word_len); UMP_H_automata_get_insert_mode_t9(insert_mode); UMP_H_automata_get_multitap_mode_t9(multitap_mode); return (T9ERR_NONE == nstatus)? UMP_R_SUCCESS : UMP_R_FAIL; T9 ( 28 / 30 )
추후세미나계획 Edit Wigdet 기간 : 4차 ~ 5차내용 : Edit Widget 사정에따라세미나계획이변경될수있습니다 T9 ( 29 / 30 )
T9 ( 30 / 30 ) 질의응답및토의