/*
 * Copyright (C) 2020 The HIME team, Taiwan
 * Copyright (C) 2011 Edward Der-Hua Liu, Hsin-Chu, Taiwan
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation version 2.1
 * of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "hime.h"

#include "gst.h"
#include "gtab.h"
#include "hime-module.h"
#include "im-client/hime-im-client-attr.h"
#include "pho.h"
#include "tsin.h"
#include "win-sym.h"

void init_tsin_selection_win (), disp_selections (int x, int y), hide_selections_win ();
void disp_arrow_up (), disp_arrow_down ();
void set_sele_text (int tN, int i, char *text, int len);
int get_widget_xy (GtkWidget *win, GtkWidget *widget, int *rx, int *ry);
void get_win_size (GtkWidget *win, int *width, int *height);
void load_tab_pho_file ();
void clear_sele ();
void send_utf8_ch (char *s);
extern gboolean force_show;

void init_HIME_module_main_functions (HIME_module_main_functions *func) {
    func->mf_move_win_sym = move_win_sym;
    func->mf_toggle_symbol_table = toggle_symbol_table;

    func->mf_init_tsin_selection_win = init_tsin_selection_win;
    func->mf_clear_sele = clear_sele;
    func->mf_disp_selections = disp_selections;
    func->mf_hide_selections_win = hide_selections_win;
    func->mf_disp_arrow_up = disp_arrow_up;
    func->mf_disp_arrow_down = disp_arrow_down;
    func->mf_set_sele_text = set_sele_text;
    func->mf_set_win1_cb = set_win1_cb;

    func->mf_set_eng_ch_mode = set_eng_ch_mode;
    func->mf_toggle_eng_ch_mode = toggle_eng_ch_mode;
    func->mf_chinese_mode = chinese_mode;
    func->mf_set_chinese_mode = set_chinese_mode;

    func->mf_get_widget_xy = get_widget_xy;
    func->mf_get_win_size = get_win_size;
    func->mf_apply_widget_bg_color = apply_widget_bg_color;
    func->mf_set_label_font_size = set_label_font_size;
    func->mf_set_no_focus = set_no_focus;

    func->mf_current_fullwidth_mode = current_fullwidth_mode;

    func->mf_exec_hime_setup = exec_hime_setup;
    func->mf_hime_edit_display_ap_only = hime_edit_display_ap_only;
    func->mf_hime_display_on_the_spot_key = hime_display_on_the_spot_key;
    func->mf_inmd_switch_popup_handler = inmd_switch_popup_handler;
    func->mf_load_tab_pho_file = load_tab_pho_file;
    func->mf_send_text = send_text;
    func->mf_send_utf8_ch = send_utf8_ch;
    func->mf_utf8_str_N = utf8_str_N;

    func->mf_phkbm = &phkbm;
    func->mf_tss = &tss;
    func->mf_hime_chinese_english_toggle_key = &hime_chinese_english_toggle_key;

    func->mf_hime_pop_up_win = &hime_pop_up_win;
    func->mf_hime_font_size = &hime_font_size;
    func->mf_hime_win_color_fg = &hime_win_color_fg;

    func->mf_hime_use_custom_theme = &hime_use_custom_theme;
    func->mf_hime_cursor_color = &hime_cursor_color;
    func->mf_pho_selkey = &pho_selkey;
    func->mf_force_show = &force_show;
    func->mf_win_x = &win_x;
    func->mf_win_y = &win_y;
    func->mf_input_window_width = &input_window_width;
    func->mf_input_window_height = &input_window_height;
    func->mf_display_width = &display_width;
    func->mf_display_height = &display_height;
    func->mf_pho_chars = pho_chars;
    func->mf_key_press_shift = &key_press_shift;
}
