cht電腦資訊gcin
adm Find login register

請介紹當初如何整何 Anthy

hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
1subject: 請介紹當初如何整何 AnthyPromote 1 Bookmark 02010-06-27quote  

gcin 到目前為止整合外來智慧型輸入法最成功的大概就是日文輸入法 Anthy。

 

能不能請 eliu 和當初為整合 Anthy 提出貢獻的人介紹一下整合的方法和步驟。讓比較初學的用戶也可以按圖索驥,嚐試整合其它的智慧型輸入法,如酷音等。

 

另外目前輸入法排列仍是手動修改 gtab.list。詞音、注音、 Anthy 三樣使用自己的特殊指標連結 !Tsin !Anthy來達到移動位置。個人覺得 IBUS 雖然有很多不完善的地方,但是在整理輸入法的 UI 有不錯的做法,另外智慧型的輸入法也可以較自由添加,甚至可以 synaptic 中另外自行加入。不知這些有沒有可能達成?

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
2subject: Promote 1 Bookmark 02010-06-27quote  

目前沒有開放的介面,反正就寫 callback functions  init, key press/release, window show/hide, get_preedit_string, reset,  move window, window_size,這邊講半天還不如自己直接去看 anthy.cpp 比較快,應該是不難才對。等有空再弄開放介面。

以後有空可能會弄 gtab.list 的 editor & installer

edited: 2
hansioux
joined: 2009-11-13
posted: 110
promoted: 6
bookmarked: 2
3subject: Promote 0 Bookmark 02010-06-29quote  

因為不會,所以請有興趣的人指點討論。

我看了一下, chewing 的 resources  :

/usr/lib/libchewing.so

/usr/include/chewing

 底下有: chewing.h

      會 call:  chewingio.h

           global.h

           modaux.h

 

新酷音最主要的 functions 好像都列在 chewingio.h 裡:

 

anthy.cpp 中主要的涵數有:

static gboolean is_empty()

static void auto_hide()

static void insert_jp(u_char rom_idx)

void parse_key()

static void clear_seg_label()

static void cursor_markup(int idx, char *s)

void minimize_win_anthy()

static void disp_keys(int idx)

static void disp_input()

static void disp_convert()

void delete_jpstr(int idx)

static void clear_all()

static void send_seg()

static void merge_jp(char out[])

static gboolean send_jp()

static void disp_select()

static void load_seg()

static void next_page()

int flush_chewing_input()

gboolean feedkey_anthy(int kv, int kvstate)

static void mouse_button_callback( GtkWidget *widget,GdkEventButton *event, gpointer data)

int init_win_anthy()

int chewing_visible()

void show_win_anthy()

void hide_win_anthy()

void change_anthy_font_size()

void move_win_anthy(int x, int y)

int feedkey_anthy_release(KeySym xkey, int kbstate)

int anthy_get_preedit(char *str, GCIN_PREEDIT_ATTR attr[], int *pcursor)

int gcin_anthy_reset()

void get_win_anthy_geom()

 

其中大部份都是操作 gtk 視窗用的,想知道 anthy 真正相關的是哪些部份?要如何和 chewingio.h 中的 function 結合。

eliu

joined: 2007-08-09
posted: 11468
promoted: 617
bookmarked: 187
新竹, 台灣
4subject: Promote 0 Bookmark 02010-06-29quote  

重點不是 call anthy 的 function,而是 gcin event 來的時候 callback function。anthy 是 f_anthy*,是不處理 key & event 的,只有 parser 而已

edited: 1

cht電腦資訊gcin
adm Find login register
views:8848