/* * Initialise the GUI. Create all the windows, set up all the call-backs * etc. */ int gui_mch_init(void) { vimjs_init(); gui.border_offset = 0; gui.border_width = 0; gui.scrollbar_width = 0; gui.scrollbar_height = 0; gui.back_pixel = gui_get_color((char_u*)"black"); gui.norm_pixel = gui_get_color((char_u*)"white"); set_normal_colors(); gui_check_colors(); gui.def_back_pixel = gui.back_pixel; gui.def_norm_pixel = gui.norm_pixel; gui.in_focus = TRUE; Rows = vimjs_get_window_height() / vimjs_get_char_height(); Columns = vimjs_get_window_width() / vimjs_get_char_width(); return OK; }
/* * Initialise vim to use the font with the given name. Return FAIL if the font * could not be loaded, OK otherwise. */ int gui_mch_init_font(char_u *font_name, int fontset) { vimjs_init_font((char*)font_name); gui.char_width = vimjs_get_char_width(); gui.char_height = vimjs_get_char_height(); gui.char_ascent = gui.char_height; char_u buf[100]; gui.norm_font = vim_strsave(font_name); vim_strncpy(buf, "bold ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.bold_font = vim_strsave(buf); vim_strncpy(buf, "italic ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.ital_font = vim_strsave(buf); vim_strncpy(buf, "bold italic ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.boldital_font = vim_strsave(buf); int w,h; w = vimjs_get_window_width(); h = vimjs_get_window_height(); gui_resize_shell(w, h); return OK; }
/* * Initialise vim to use the font with the given name. Return FAIL if the font * could not be loaded, OK otherwise. */ int gui_mch_init_font(char_u *font_name, int fontset) { vimjs_init_font((char*)font_name); gui.char_width = vimjs_get_char_width(); gui.char_height = vimjs_get_char_height(); gui_browser_resize(); return OK; }