diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2011-08-28 22:15:44 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2011-08-28 22:15:44 +0900 |
commit | c2c8b0a05f2d82af5b04a7f37c2bad4cac2dee4b (patch) | |
tree | 3ffd4b785c637ec0e26f82fea89d8d60bc13c45e | |
parent | 72e25b18a3975a7673ec6b2371f7989d6707b808 (diff) | |
download | libhangul-c2c8b0a05f2d82af5b04a7f37c2bad4cac2dee4b.tar.gz |
hangul_ic_is_transliteration() 함수 추가
이 함수는 hangul_ic_process()에 키코드를 넘기기 전에
normalize 과정에 필요한지 판단해주는 함수다.
git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@264 8f00fcd2-89fc-0310-932e-b01be5b65e01
-rw-r--r-- | hangul/hangul.h | 1 | ||||
-rw-r--r-- | hangul/hangulinputcontext.c | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/hangul/hangul.h b/hangul/hangul.h index 648e339..4957c29 100644 --- a/hangul/hangul.h +++ b/hangul/hangul.h @@ -114,6 +114,7 @@ bool hangul_ic_is_empty(HangulInputContext *hic); bool hangul_ic_has_choseong(HangulInputContext *hic); bool hangul_ic_has_jungseong(HangulInputContext *hic); bool hangul_ic_has_jongseong(HangulInputContext *hic); +bool hangul_ic_is_transliteration(HangulInputContext *hic); void hangul_ic_set_output_mode(HangulInputContext *hic, int mode); void hangul_ic_set_keyboard(HangulInputContext *hic, diff --git a/hangul/hangulinputcontext.c b/hangul/hangulinputcontext.c index 7a0878f..08fd869 100644 --- a/hangul/hangulinputcontext.c +++ b/hangul/hangulinputcontext.c @@ -1845,3 +1845,30 @@ hangul_ic_get_keyboard_name(unsigned index_) return NULL; } + +/** + * @ingroup hangulic + * @brief 주어진 hic가 transliteration method인지 판별 + * @param hic 상태를 알고자 하는 HangulInputContext 포인터 + * @return hic가 transliteration method인 경우 true를 리턴, 아니면 false + * + * 이 함수는 @a hic 가 transliteration method인지 판별하는 함수다. + * 이 함수가 false를 리턴할 경우에는 process 함수에 keycode를 넘기기 전에 + * 키보드 자판 배열에 독립적인 값으로 변환한 후 넘겨야 한다. + * 그렇지 않으면 유럽어 자판과 한국어 자판을 같이 쓸때 한글 입력이 제대로 + * 되지 않는다. + */ +bool +hangul_ic_is_transliteration(HangulInputContext *hic) +{ + int type; + + if (hic == NULL) + return false; + + type = hangul_keyboard_get_type(hic->keyboard); + if (type == HANGUL_KEYBOARD_TYPE_ROMAJA) + return true; + + return false; +} |