1 /*
2  * Copyright (C) 2020 The HIME team, Taiwan
3  * Copyright (C) 2011 Edward Der-Hua Liu, Hsin-Chu, Taiwan
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation version 2.1
8  * of the License.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #include "hime.h"
21 
22 #include "gst.h"
23 #include "gtab.h"
24 #include "hime-module.h"
25 #include "im-client/hime-im-client-attr.h"
26 #include "pho.h"
27 #include "tsin.h"
28 #include "win-sym.h"
29 
30 void init_tsin_selection_win (), disp_selections (int x, int y), hide_selections_win ();
31 void disp_arrow_up (), disp_arrow_down (), set_tsin_pho_mode ();
32 void set_sele_text (int tN, int i, char *text, int len);
33 void tsin_set_eng_ch (int nmod);
34 int get_widget_xy (GtkWidget *win, GtkWidget *widget, int *rx, int *ry);
35 void get_win_size (GtkWidget *win, int *width, int *height);
36 void load_tab_pho_file ();
37 void clear_sele ();
38 void send_utf8_ch (char *s);
39 extern gboolean force_show;
40 int current_shape_mode ();
41 
init_HIME_module_main_functions(HIME_module_main_functions * func)42 void init_HIME_module_main_functions (HIME_module_main_functions *func) {
43     func->mf_show_win_sym = show_win_sym;
44     func->mf_hide_win_sym = hide_win_sym;
45     func->mf_move_win_sym = move_win_sym;
46     func->mf_toggle_win_sym = toggle_win_sym;
47 
48     func->mf_init_tsin_selection_win = init_tsin_selection_win;
49     func->mf_clear_sele = clear_sele;
50     func->mf_disp_selections = disp_selections;
51     func->mf_hide_selections_win = hide_selections_win;
52     func->mf_disp_arrow_up = disp_arrow_up;
53     func->mf_disp_arrow_down = disp_arrow_down;
54     func->mf_set_sele_text = set_sele_text;
55     func->mf_set_win1_cb = set_win1_cb;
56 
57     func->mf_tsin_set_eng_ch = tsin_set_eng_ch;
58     func->mf_tsin_pho_mode = tsin_pho_mode;
59     func->mf_set_tsin_pho_mode = set_tsin_pho_mode;
60 
61     func->mf_get_widget_xy = get_widget_xy;
62     func->mf_get_win_size = get_win_size;
63     func->mf_change_win_bg = change_win_bg;
64     func->mf_set_label_font_size = set_label_font_size;
65     func->mf_set_no_focus = set_no_focus;
66 
67     func->mf_current_shape_mode = current_shape_mode;
68 
69     func->mf_exec_hime_setup = exec_hime_setup;
70     func->mf_hime_edit_display_ap_only = hime_edit_display_ap_only;
71     func->mf_hime_display_on_the_spot_key = hime_display_on_the_spot_key;
72     func->mf_inmd_switch_popup_handler = inmd_switch_popup_handler;
73     func->mf_load_tab_pho_file = load_tab_pho_file;
74     func->mf_send_text = send_text;
75     func->mf_send_utf8_ch = send_utf8_ch;
76     func->mf_utf8_str_N = utf8_str_N;
77 
78     func->mf_phkbm = &phkbm;
79     func->mf_tss = &tss;
80     func->mf_tsin_chinese_english_toggle_key = &tsin_chinese_english_toggle_key;
81 
82     func->mf_hime_pop_up_win = &hime_pop_up_win;
83     func->mf_hime_font_size = &hime_font_size;
84     func->mf_hime_win_color_fg = &hime_win_color_fg;
85 
86     func->mf_hime_win_color_use = &hime_win_color_use;
87     func->mf_tsin_cursor_color = &tsin_cursor_color;
88     func->mf_pho_selkey = &pho_selkey;
89     func->mf_force_show = &force_show;
90     func->mf_win_x = &win_x;
91     func->mf_win_y = &win_y;
92     func->mf_win_xl = &win_xl;
93     func->mf_win_yl = &win_yl;
94     func->mf_dpy_xl = &dpy_xl;
95     func->mf_dpy_yl = &dpy_yl;
96     func->mf_pho_chars = pho_chars;
97 }
98