void termit_tab_set_color_background(struct TermitTab* pTab, const GdkColor* p_color) { if (p_color) { pTab->style.background_color = gdk_color_copy(p_color); vte_terminal_set_color_background(VTE_TERMINAL(pTab->vte), pTab->style.background_color); } }
/* * Class: com_randomwalking_swt_terminal_internal_Vte * Method: _vte_terminal_set_color_background * Signature: (ILorg/eclipse/swt/internal/gtk/GdkColor;)V */ JNIEXPORT void JNICALL Java_com_randomwalking_swt_terminal_internal_Vte__1vte_1terminal_1set_1color_1background (JNIEnv * env, jclass obj, jint terminal, jobject color) { GdkColor _color, *lcolor=NULL; if (color) if ((lcolor = getGdkColorFields(env, color, &_color)) != NULL) { vte_terminal_set_color_background(VTE_TERMINAL(terminal), lcolor); } }
void set_vte_color(struct Window *win_data, struct Page *page_data) { #ifdef DETAIL g_debug("! Launch set_vte_color() with win_data = %p, page_data = %p", win_data, page_data); #endif #ifdef DEFENSIVE if ((win_data==NULL) || (page_data==NULL) || (page_data->vte==NULL)) return; #endif // set font/background colors vte_terminal_set_default_colors(VTE_TERMINAL(page_data->vte)); // g_debug("win_data->use_set_color_fg_bg = %d", win_data->use_set_color_fg_bg); if (win_data->use_set_color_fg_bg) { // g_debug("win_data->use_set_color_fg_bg = %d", win_data->use_set_color_fg_bg); vte_terminal_set_colors(VTE_TERMINAL(page_data->vte), &(win_data->fg_color), &(win_data->bg_color), win_data->color, 16); } else { vte_terminal_set_color_foreground(VTE_TERMINAL(page_data->vte), &(win_data->fg_color)); vte_terminal_set_color_background(VTE_TERMINAL(page_data->vte), &(win_data->bg_color)); } vte_terminal_set_color_cursor(VTE_TERMINAL(page_data->vte), &(win_data->cursor_color)); vte_terminal_set_color_bold (VTE_TERMINAL(page_data->vte), &(win_data->fg_color)); vte_terminal_set_background_tint_color (VTE_TERMINAL(page_data->vte), &(win_data->bg_color)); }
void termit_tab_apply_colors(struct TermitTab* pTab) { if (pTab->style.colors) { vte_terminal_set_colors(VTE_TERMINAL(pTab->vte), NULL, NULL, pTab->style.colors, pTab->style.colors_size); } if (pTab->style.foreground_color) { vte_terminal_set_color_foreground(VTE_TERMINAL(pTab->vte), pTab->style.foreground_color); } if (pTab->style.background_color) { vte_terminal_set_color_background(VTE_TERMINAL(pTab->vte), pTab->style.background_color); } }
void on_vte_realize(VteTerminal *vte, G_GNUC_UNUSED gpointer gdata) { vte_terminal_set_emulation(vte, pref_vte_emulation); vte_terminal_set_font_from_string(vte, pref_vte_font); vte_terminal_set_scrollback_lines(vte, pref_vte_scrollback); vte_terminal_set_scroll_on_output(vte, TRUE); vte_terminal_set_color_foreground(vte, &pref_vte_colour_fore); vte_terminal_set_color_background(vte, &pref_vte_colour_back); #if VTE_CHECK_VERSION(0, 17, 1) vte_terminal_set_cursor_blink_mode(vte, pref_vte_blinken ? VTE_CURSOR_BLINK_ON : VTE_CURSOR_BLINK_OFF); #else vte_terminal_set_cursor_blinks(vte, pref_vte_blinken); #endif }
static void hotssh_tab_style_updated (GtkWidget *widget) { HotSshTab *self = (HotSshTab*)widget; HotSshTabPrivate *priv = hotssh_tab_get_instance_private (self); GdkRGBA fg, bg; GTK_WIDGET_CLASS (hotssh_tab_parent_class)->style_updated (widget); /* Hardcode black on white for now; in the future I'd like to do * per-host colors. */ fg.red = fg.blue = fg.green = 0; fg.alpha = 1; bg.red = bg.blue = bg.green = 1; bg.alpha = 1; vte_terminal_set_color_foreground ((VteTerminal*)priv->terminal, &fg); vte_terminal_set_color_background ((VteTerminal*)priv->terminal, &bg); vte_terminal_set_color_bold ((VteTerminal*)priv->terminal, &fg); }
void terminal::setup_terminal() { if ( m_terminal && m_configuration ) { GError *error = NULL; vte_terminal_set_scrollback_lines(m_terminal, m_configuration->get_scrollback_lines()); vte_terminal_set_allow_bold(m_terminal, m_configuration->get_allow_bold()); vte_terminal_set_audible_bell(m_terminal, m_configuration->get_audible_bell()); vte_terminal_set_scroll_on_keystroke(m_terminal, m_configuration->get_scroll_on_keystroke()); vte_terminal_set_scroll_on_output(m_terminal, m_configuration->get_scroll_on_output()); vte_terminal_set_rewrap_on_resize(m_terminal, m_configuration->get_rewrap_on_resize()); vte_terminal_set_mouse_autohide(m_terminal, m_configuration->get_autohide_mouse()); if ( ! vte_terminal_set_encoding(m_terminal, m_configuration->get_encoding().c_str(), &error) ) { sterm::common::warning("sterm::terminal", "failed to set terminal encoding to '%s'", m_configuration->get_encoding().c_str()); sterm::common::debug("sterm::terminal", "VteTerminal error message: %s", error->message); } std::string word_chars = m_configuration->get_word_chars(); if ( ! word_chars.empty() ) vte_terminal_set_word_char_exceptions(m_terminal, word_chars.c_str()); else vte_terminal_set_word_char_exceptions(m_terminal, NULL); vte_terminal_set_cursor_blink_mode(m_terminal, m_configuration->get_cursor_blink_mode()); vte_terminal_set_cursor_shape(m_terminal, m_configuration->get_cursor_shape()); PangoFontDescription *font = NULL; if ( m_configuration->copy_font_description(&font) ) { vte_terminal_set_font(m_terminal, font); pango_font_description_free(font); } else { vte_terminal_set_font(m_terminal, NULL); } std::vector<GdkRGBA> color_palette = m_configuration->get_color_palette(); color foreground = m_configuration->get_foreground_color(); color background = m_configuration->get_background_color(); color bold_color = m_configuration->get_bold_color(); color cursor_color = m_configuration->get_cursor_color(); color highlight_bg = m_configuration->get_highlight_bg_color(); color highlight_fg = m_configuration->get_highlight_fg_color(); if ( color_palette.size() == PALETTE_SIZE ) vte_terminal_set_colors(m_terminal, NULL, NULL, color_palette.data(), PALETTE_SIZE); else vte_terminal_set_default_colors(m_terminal); if ( foreground.set ) vte_terminal_set_color_foreground(m_terminal, &(foreground.value)); if ( background.set ) vte_terminal_set_color_background(m_terminal, &(background.value)); if ( bold_color.set ) vte_terminal_set_color_bold(m_terminal, &(bold_color.value)); else vte_terminal_set_color_bold(m_terminal, NULL); if ( cursor_color.set ) vte_terminal_set_color_cursor(m_terminal, &(cursor_color.value)); else vte_terminal_set_color_cursor(m_terminal, NULL); if ( highlight_bg.set ) vte_terminal_set_color_highlight(m_terminal, &(highlight_bg.value)); else vte_terminal_set_color_highlight(m_terminal, NULL); if ( highlight_fg.set ) vte_terminal_set_color_highlight_foreground(m_terminal, &(highlight_fg.value)); else vte_terminal_set_color_highlight_foreground(m_terminal, NULL); } }
static VALUE rg_set_color_background(VALUE self, VALUE background) { vte_terminal_set_color_background(_SELF(self), RVAL2GDKCOLOR(background)); return self; }
static VALUE term_set_color_background(VALUE self, VALUE background) { vte_terminal_set_color_background(RVAL2TERM(self), RVAL2COLOR(background)); return Qnil; }
void set_data(struct v *p){ vte_terminal_set_color_background(VTE_TERMINAL(p-> vte), &bcolor); vte_terminal_set_color_foreground(VTE_TERMINAL(p-> vte), &fcolor); }