Exemple #1
0
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();
}
Exemple #2
0
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();
}