gnome-terminal r2575 - trunk/src



Author: chpe
Date: Thu May 29 19:35:02 2008
New Revision: 2575
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2575&view=rev

Log:
Remove TerminalEraseBinding, and use VteTerminalEraseBinding directly instead.


Modified:
   trunk/src/terminal-profile.c
   trunk/src/terminal-profile.h
   trunk/src/terminal-screen.c
   trunk/src/terminal-widget-vte.c
   trunk/src/terminal-widget.h

Modified: trunk/src/terminal-profile.c
==============================================================================
--- trunk/src/terminal-profile.c	(original)
+++ trunk/src/terminal-profile.c	Thu May 29 19:35:02 2008
@@ -107,8 +107,8 @@
   char *background_image_file;
   GdkPixbuf *background_image;
   double background_darkness;
-  TerminalEraseBinding backspace_binding;
-  TerminalEraseBinding delete_binding;
+  VteTerminalEraseBinding backspace_binding;
+  VteTerminalEraseBinding delete_binding;
 
   PangoFontDescription *font;
   
@@ -178,10 +178,11 @@
   { -1, NULL }
 };
 
+/* FIXMEchpe make these use the same strings as vte */
 static const GConfEnumStringPair erase_bindings[] = {
-  { TERMINAL_ERASE_CONTROL_H, "control-h" },
-  { TERMINAL_ERASE_ESCAPE_SEQUENCE, "escape-sequence" },
-  { TERMINAL_ERASE_ASCII_DEL, "ascii-del" },
+  { VTE_ERASE_ASCII_BACKSPACE, "control-h" },
+  { VTE_ERASE_DELETE_SEQUENCE, "escape-sequence" },
+  { VTE_ERASE_ASCII_DELETE, "ascii-del" },
   { -1, NULL }
 };
 
@@ -263,8 +264,8 @@
   priv->background_type = TERMINAL_BACKGROUND_SOLID;
   priv->background_image_file = g_strdup ("");
   priv->background_darkness = 0.0;
-  priv->backspace_binding = TERMINAL_ERASE_ASCII_DEL;
-  priv->delete_binding = TERMINAL_ERASE_ESCAPE_SEQUENCE;
+  priv->backspace_binding = VTE_ERASE_ASCII_DELETE;
+  priv->delete_binding = VTE_ERASE_DELETE_SEQUENCE;
   priv->use_theme_colors = TRUE;
   priv->use_system_font = TRUE;
   priv->no_aa_without_render = TRUE;
@@ -1345,17 +1346,17 @@
   g_free (key);
 }
 
-TerminalEraseBinding
+VteTerminalEraseBinding
 terminal_profile_get_backspace_binding (TerminalProfile *profile)
 {
-  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), TERMINAL_ERASE_ASCII_DEL);
+  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), VTE_ERASE_ASCII_DELETE);
 
   return profile->priv->backspace_binding;
 }
 
 void
 terminal_profile_set_backspace_binding (TerminalProfile        *profile,
-                                        TerminalEraseBinding    binding)
+                                        VteTerminalEraseBinding    binding)
 {
   TerminalProfilePrivate *priv = profile->priv;
   char *key;
@@ -1376,17 +1377,17 @@
   g_free (key);
 }
 
-TerminalEraseBinding
+VteTerminalEraseBinding
 terminal_profile_get_delete_binding (TerminalProfile *profile)
 {
-  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), TERMINAL_ERASE_ESCAPE_SEQUENCE);
+  g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), VTE_ERASE_DELETE_SEQUENCE);
 
   return profile->priv->delete_binding;
 }
 
 void
 terminal_profile_set_delete_binding (TerminalProfile      *profile,
-                                     TerminalEraseBinding  binding)
+                                     VteTerminalEraseBinding  binding)
 {
   TerminalProfilePrivate *priv = profile->priv;
   char *key;
@@ -1876,7 +1877,7 @@
                        const char      *str_val)
 {
   TerminalProfilePrivate *priv = profile->priv;
-  int binding; /* TerminalEraseBinding */
+  int binding; /* VteTerminalEraseBinding */
   
   if (str_val &&
       gconf_string_to_enum (erase_bindings, str_val, &binding) &&
@@ -1894,7 +1895,7 @@
                     const char      *str_val)
 {
   TerminalProfilePrivate *priv = profile->priv;
-  int binding; /* TerminalEraseBinding */
+  int binding; /* VteTerminalEraseBinding */
   
   if (str_val &&
       gconf_string_to_enum (erase_bindings, str_val, &binding) &&

Modified: trunk/src/terminal-profile.h
==============================================================================
--- trunk/src/terminal-profile.h	(original)
+++ trunk/src/terminal-profile.h	Thu May 29 19:35:02 2008
@@ -24,6 +24,7 @@
 #define TERMINAL_PROFILE_H
 
 #include <gtk/gtk.h>
+#include <vte/vte.h>
 #include <gconf/gconf-client.h>
 
 #define CONF_PREFIX "/apps/gnome-terminal"
@@ -78,13 +79,6 @@
   TERMINAL_TITLE_IGNORE
 } TerminalTitleMode;
 
-typedef enum
-{
-  TERMINAL_ERASE_ASCII_DEL,
-  TERMINAL_ERASE_ESCAPE_SEQUENCE,
-  TERMINAL_ERASE_CONTROL_H
-} TerminalEraseBinding;
-
 #define TERMINAL_PALETTE_SIZE 16
 
 typedef enum
@@ -175,8 +169,8 @@
 const char*            terminal_profile_get_background_image_file (TerminalProfile *profile);
 gboolean               terminal_profile_get_scroll_background     (TerminalProfile *profile);
 double                 terminal_profile_get_background_darkness   (TerminalProfile *profile);
-TerminalEraseBinding   terminal_profile_get_backspace_binding     (TerminalProfile *profile);
-TerminalEraseBinding   terminal_profile_get_delete_binding        (TerminalProfile *profile);
+VteTerminalEraseBinding terminal_profile_get_backspace_binding     (TerminalProfile *profile);
+VteTerminalEraseBinding terminal_profile_get_delete_binding        (TerminalProfile *profile);
 
 gboolean               terminal_profile_get_use_theme_colors      (TerminalProfile *profile);
 gboolean               terminal_profile_get_use_system_font       (TerminalProfile *profile);
@@ -240,9 +234,9 @@
 void terminal_profile_set_background_darkness   (TerminalProfile        *profile,
                                                  double                  setting);
 void terminal_profile_set_backspace_binding     (TerminalProfile        *profile,
-                                                 TerminalEraseBinding    binding);
+                                                 VteTerminalEraseBinding    binding);
 void terminal_profile_set_delete_binding        (TerminalProfile        *profile,
-                                                 TerminalEraseBinding    binding);
+                                                 VteTerminalEraseBinding    binding);
 
 void terminal_profile_set_use_theme_colors      (TerminalProfile        *profile,
                                                  gboolean                setting);

Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c	(original)
+++ trunk/src/terminal-screen.c	Thu May 29 19:35:02 2008
@@ -633,11 +633,11 @@
   else
     terminal_widget_set_background_transparent (term, FALSE);
 
-  terminal_widget_set_backspace_binding (term,
-                                         terminal_profile_get_backspace_binding (profile));
+  vte_terminal_set_backspace_binding (VTE_TERMINAL (screen),
+                                      terminal_profile_get_backspace_binding (profile));
   
-  terminal_widget_set_delete_binding (term,
-                                      terminal_profile_get_delete_binding (profile));
+  vte_terminal_set_delete_binding (VTE_TERMINAL (screen),
+                                   terminal_profile_get_delete_binding (profile));
 }
 
 /**

Modified: trunk/src/terminal-widget-vte.c
==============================================================================
--- trunk/src/terminal-widget-vte.c	(original)
+++ trunk/src/terminal-widget-vte.c	Thu May 29 19:35:02 2008
@@ -246,54 +246,6 @@
 }
 
 void
-terminal_widget_set_delete_binding (GtkWidget           *widget,
-				    TerminalEraseBinding binding)
-{
-  switch (binding) {
-    case TERMINAL_ERASE_ASCII_DEL:
-      vte_terminal_set_delete_binding(VTE_TERMINAL(widget),
-		      		      VTE_ERASE_ASCII_DELETE);
-      break;
-    case TERMINAL_ERASE_ESCAPE_SEQUENCE:
-      vte_terminal_set_delete_binding(VTE_TERMINAL(widget),
-		      		      VTE_ERASE_DELETE_SEQUENCE);
-      break;
-    case TERMINAL_ERASE_CONTROL_H:
-      vte_terminal_set_delete_binding(VTE_TERMINAL(widget),
-		      		      VTE_ERASE_ASCII_BACKSPACE);
-      break;
-    default:
-      vte_terminal_set_delete_binding(VTE_TERMINAL(widget),
-		      		      VTE_ERASE_AUTO);
-      break;
-  }
-}
-
-void
-terminal_widget_set_backspace_binding (GtkWidget            *widget,
-				       TerminalEraseBinding  binding)
-{
-  switch (binding) {
-    case TERMINAL_ERASE_ASCII_DEL:
-      vte_terminal_set_backspace_binding(VTE_TERMINAL(widget),
-		      			 VTE_ERASE_ASCII_DELETE);
-      break;
-    case TERMINAL_ERASE_ESCAPE_SEQUENCE:
-      vte_terminal_set_backspace_binding(VTE_TERMINAL(widget),
-		      			 VTE_ERASE_DELETE_SEQUENCE);
-      break;
-    case TERMINAL_ERASE_CONTROL_H:
-      vte_terminal_set_backspace_binding(VTE_TERMINAL(widget),
-		      			 VTE_ERASE_ASCII_BACKSPACE);
-      break;
-    default:
-      vte_terminal_set_backspace_binding(VTE_TERMINAL(widget),
-		      			 VTE_ERASE_AUTO);
-      break;
-  }
-}
-
-void
 terminal_widget_set_cursor_blinks (GtkWidget *widget,
 				   gboolean   setting)
 {

Modified: trunk/src/terminal-widget.h
==============================================================================
--- trunk/src/terminal-widget.h	(original)
+++ trunk/src/terminal-widget.h	Thu May 29 19:35:02 2008
@@ -67,10 +67,6 @@
 void       terminal_widget_skey_match_remove          (GtkWidget            *widget);
 void       terminal_widget_set_word_characters        (GtkWidget            *widget,
                                                        const char           *str);
-void       terminal_widget_set_delete_binding         (GtkWidget            *widget,
-                                                       TerminalEraseBinding  binding);
-void       terminal_widget_set_backspace_binding      (GtkWidget            *widget,
-                                                       TerminalEraseBinding  binding);
 void       terminal_widget_set_cursor_blinks          (GtkWidget            *widget,
                                                        gboolean              setting);
 void       terminal_widget_set_audible_bell           (GtkWidget            *widget,



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