void vte_init(void) { if (vte_info.have_vte == FALSE) { /* vte_info.have_vte can be false even if VTE is compiled in, think of command line option */ geany_debug("Disabling terminal support"); return; } if (NZV(vte_info.lib_vte)) { module = g_module_open(vte_info.lib_vte, G_MODULE_BIND_LAZY); } #ifdef VTE_MODULE_PATH else { module = g_module_open(VTE_MODULE_PATH, G_MODULE_BIND_LAZY); } #endif if (module == NULL) { gint i; const gchar *sonames[] = { "libvte.so", "libvte.so.4", "libvte.so.8", "libvte.so.9", NULL }; for (i = 0; sonames[i] != NULL && module == NULL; i++) { module = g_module_open(sonames[i], G_MODULE_BIND_LAZY); } } if (module == NULL) { vte_info.have_vte = FALSE; geany_debug("Could not load libvte.so, embedded terminal support disabled"); return; } else { vf = g_new0(struct VteFunctions, 1); if (vte_register_symbols(module)) vte_info.have_vte = TRUE; else { vte_info.have_vte = FALSE; g_free(vf); /* FIXME: is closing the module safe? see vte_close() and test on FreeBSD */ /*g_module_close(module);*/ module = NULL; return; } } create_vte(); /* setup the F10 menu override (so it works before the widget is first realised). */ override_menu_key(); }
void vte_init(void) { if (vte_info.have_vte == FALSE) { /* vte_info.have_vte can be false even if VTE is compiled in, think of command line option */ geany_debug("Disabling terminal support"); return; } if (NZV(vte_info.lib_vte)) { module = g_module_open(vte_info.lib_vte, G_MODULE_BIND_LAZY); } #ifdef VTE_MODULE_PATH else { module = g_module_open(VTE_MODULE_PATH, G_MODULE_BIND_LAZY); } #endif if (module == NULL) { gint i; const gchar *sonames[] = { "/opt/local/lib/libvte.dylib", NULL }; for (i = 0; sonames[i] != NULL && module == NULL; i++) { module = g_module_open(sonames[i], G_MODULE_BIND_LAZY); } } if (module == NULL) { vte_info.have_vte = FALSE; geany_debug("Could not load libvte.dylib, embedded terminal support disabled"); return; } else { vte_info.have_vte = TRUE; vf = g_new0(struct VteFunctions, 1); vte_register_symbols(module); } create_vte(); /* setup the F10 menu override (so it works before the widget is first realised). */ override_menu_key(); }
void vte_apply_user_settings(void) { if (! ui_prefs.msgwindow_visible) return; vf->vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->vte), vc->scrollback_lines); vf->vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(vc->vte), vc->scroll_on_key); vf->vte_terminal_set_scroll_on_output(VTE_TERMINAL(vc->vte), vc->scroll_on_out); vf->vte_terminal_set_emulation(VTE_TERMINAL(vc->vte), vc->emulation); vf->vte_terminal_set_font_from_string(VTE_TERMINAL(vc->vte), vc->font); vf->vte_terminal_set_color_foreground(VTE_TERMINAL(vc->vte), vc->colour_fore); vf->vte_terminal_set_color_bold(VTE_TERMINAL(vc->vte), vc->colour_fore); vf->vte_terminal_set_color_background(VTE_TERMINAL(vc->vte), vc->colour_back); vf->vte_terminal_set_audible_bell(VTE_TERMINAL(vc->vte), prefs.beep_on_errors); vte_set_cursor_blink_mode(); override_menu_key(); }