[vte/vte-next] Add terminal style class



commit 98d5dd2acbfecaa2f004ce8994030faafea7359e
Author: Christian Persch <chpe gnome org>
Date:   Sun May 29 01:05:03 2011 +0200

    Add terminal style class

 doc/reference/vte-sections.txt |    3 +++
 src/vte.c                      |    5 ++++-
 src/vte.h                      |    9 +++++++++
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 92abc2f..6423c2e 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -61,6 +61,9 @@ vte_terminal_search_set_gregex
 vte_terminal_search_set_wrap_around
 
 <SUBSECTION>
+VTE_STYLE_CLASS_TERMINAL
+
+<SUBSECTION>
 vte_get_default_emulation
 vte_get_user_shell
 
diff --git a/src/vte.c b/src/vte.c
index 4fa6963..77dc990 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -7525,6 +7525,7 @@ static void
 vte_terminal_init(VteTerminal *terminal)
 {
 	VteTerminalPrivate *pvt;
+        GtkStyleContext *context;
 
 	_vte_debug_print(VTE_DEBUG_LIFECYCLE, "vte_terminal_init()\n");
 
@@ -7663,9 +7664,11 @@ vte_terminal_init(VteTerminal *terminal)
 	/* gtk_widget_get_accessible(&terminal->widget); */
 #endif
 
-        gtk_style_context_add_provider (gtk_widget_get_style_context (&terminal->widget),
+        context = gtk_widget_get_style_context (&terminal->widget);
+        gtk_style_context_add_provider (context,
                                         VTE_TERMINAL_GET_CLASS (terminal)->priv->style_provider,
                                         GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
+        gtk_style_context_add_class (context, VTE_STYLE_CLASS_TERMINAL);
 
         vte_terminal_update_style (terminal);
 }
diff --git a/src/vte.h b/src/vte.h
index 433cb9e..5cf50a0 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -174,6 +174,15 @@ typedef enum {
         VTE_TERMINAL_EFFECT_COLOR
 } VteTerminalEffect;
 
+/**
+ * VTE_STYLE_CLASS_TERMINAL:
+ *
+ * A CSS class to match terminals.
+ *
+ * Since: 0.30
+ */
+#define VTE_STYLE_CLASS_TERMINAL "terminal"
+
 /* The structure we return as the supplemental attributes for strings. */
 typedef struct _VteCharAttributes VteCharAttributes;
 struct _VteCharAttributes {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]