Exemplo n.º 1
0
GtkWidget* build_term(void)
{
    if(!popupmenu)
        build_popupmenu();

    GtkWidget* term = vte_terminal_new();

    term_fork_command(VTE_TERMINAL(term), conf_get_shell());
    
    if (conf_get_bg_image() != NULL)
        vte_terminal_set_background_image_file(VTE_TERMINAL(term), conf_get_bg_image());
    
    GdkColor fore, back;
    fore = conf_get_fg();
    back = conf_get_bg();
    GdkColor *palette = conf_get_color_palette();
    
    if(palette == NULL)
        vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, NULL, 0);
    else
        vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, palette, 16);
    
    #if VTE_CHECK_VERSION(0,25,0)
    vte_pty_set_term(vte_terminal_get_pty_object(VTE_TERMINAL(term)), conf_get_emulation());
    #endif
    
    vte_terminal_set_background_tint_color(VTE_TERMINAL(term), &back);

    vte_terminal_set_allow_bold(VTE_TERMINAL(term), conf_get_allow_bold());
    vte_terminal_set_scroll_on_output(VTE_TERMINAL(term), conf_get_scroll_on_output());
    vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(term), TRUE);
    vte_terminal_set_font_from_string(VTE_TERMINAL(term), conf_get_font());
    vte_terminal_set_scrollback_lines(VTE_TERMINAL(term), conf_get_lines());
    vte_terminal_set_backspace_binding(VTE_TERMINAL(term), 
        VTE_ERASE_ASCII_DELETE);
    vte_terminal_set_word_chars(VTE_TERMINAL(term),
        "-A-Za-z0-9_$.+!*(),;:@&=?/~#%");

    GdkColor cursor = conf_get_cursor_color();

    vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(term), conf_get_cursor_blink() ?
        VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF);
    vte_terminal_set_cursor_shape(VTE_TERMINAL(term), conf_get_cursor_shape());
    vte_terminal_set_color_cursor(VTE_TERMINAL(term), &cursor);
    

    term_connect_signals(term);

    return term;
}
Exemplo n.º 2
0
GtkWidget* build_term(void) {
    if (!popupmenu)
        build_popupmenu();

    GtkWidget* term = vte_terminal_new();

    vte_terminal_fork_command(VTE_TERMINAL(term), conf_get_shell(), NULL, NULL,
            "", TRUE, TRUE, TRUE);
    
    if (conf_get_bg_image() != NULL)
        vte_terminal_set_background_image_file(VTE_TERMINAL(term), conf_get_bg_image());
    
    GdkColor fore, back;
    fore = conf_get_fg();
    back = conf_get_bg();
    GdkColor *palette = conf_get_color_palette();
    if (palette == NULL)
        vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, NULL, 0);
    else
        vte_terminal_set_colors(VTE_TERMINAL(term), &fore, &back, palette, 16);
    vte_terminal_set_background_tint_color(VTE_TERMINAL(term), &back);

    vte_terminal_set_allow_bold(VTE_TERMINAL(term), conf_get_allow_bold());
    vte_terminal_set_scroll_on_output(VTE_TERMINAL(term), conf_get_scroll_on_output());
    vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(term), TRUE);
    vte_terminal_set_font_from_string(VTE_TERMINAL(term), conf_get_font());
    vte_terminal_set_scrollback_lines(VTE_TERMINAL(term), conf_get_lines());
    vte_terminal_set_backspace_binding(VTE_TERMINAL(term), 
            VTE_ERASE_ASCII_DELETE);
    vte_terminal_set_audible_bell (VTE_TERMINAL(term), conf_get_bell());
	vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(term), conf_get_cursor_blink());
	vte_terminal_set_cursor_shape(VTE_TERMINAL(term), conf_get_cursor_shape());
    
    term_connect_signals(term);
    return term;
}