vte r2245 - in trunk: . src



Author: behdad
Date: Mon Dec  1 03:01:09 2008
New Revision: 2245
URL: http://svn.gnome.org/viewvc/vte?rev=2245&view=rev

Log:
2008-11-30  Behdad Esfahbod  <behdad gnome org>

        * src/vteseq-list.h:
        * src/vteseq.c (vte_sequence_handler_scroll_down),
        (vte_sequence_handler_scroll_up):
        Implement these calling vte_terminal_scroll() directly instead of 
        multiple'ing.



Modified:
   trunk/ChangeLog
   trunk/src/vteseq-list.h
   trunk/src/vteseq.c

Modified: trunk/src/vteseq-list.h
==============================================================================
--- trunk/src/vteseq-list.h	(original)
+++ trunk/src/vteseq-list.h	Mon Dec  1 03:01:09 2008
@@ -86,9 +86,7 @@
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_sc)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_screen_alignment_test)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_scroll_down)
-VTE_SEQUENCE_HANDLER(vte_sequence_handler_scroll_down_one)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_scroll_up)
-VTE_SEQUENCE_HANDLER(vte_sequence_handler_scroll_up_one)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_se)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_send_primary_device_attributes)
 VTE_SEQUENCE_HANDLER(vte_sequence_handler_send_secondary_device_attributes)

Modified: trunk/src/vteseq.c
==============================================================================
--- trunk/src/vteseq.c	(original)
+++ trunk/src/vteseq.c	Mon Dec  1 03:01:09 2008
@@ -2012,17 +2012,6 @@
 	return FALSE;
 }
 
-/* Scroll the text down one line, but don't move the cursor. */
-static gboolean
-vte_sequence_handler_scroll_down_one(VteTerminal *terminal,
-				     const char *match,
-				     GQuark match_quark,
-				     GValueArray *params)
-{
-	_vte_terminal_scroll (terminal, 1);
-	return FALSE;
-}
-
 /* Scroll the text down, but don't move the cursor. */
 static gboolean
 vte_sequence_handler_scroll_down(VteTerminal *terminal,
@@ -2030,18 +2019,18 @@
 				 GQuark match_quark,
 				 GValueArray *params)
 {
-	return vte_sequence_handler_multiple(terminal, match, match_quark,
-					     params, vte_sequence_handler_scroll_down_one);
-}
+	long val = 1;
+	GValue *value;
 
-/* Scroll the text up one line, but don't move the cursor. */
-static gboolean
-vte_sequence_handler_scroll_up_one(VteTerminal *terminal,
-				   const char *match,
-				   GQuark match_quark,
-				   GValueArray *params)
-{
-	_vte_terminal_scroll (terminal, -1);
+	if ((params != NULL) && (params->n_values > 0)) {
+		value = g_value_array_get_nth(params, 0);
+		if (G_VALUE_HOLDS_LONG(value)) {
+			val = g_value_get_long(value);
+			val = MAX(val, 1);
+		}
+	}
+
+	_vte_terminal_scroll (terminal, val);
 	return FALSE;
 }
 
@@ -2052,8 +2041,19 @@
 			       GQuark match_quark,
 			       GValueArray *params)
 {
-	return vte_sequence_handler_multiple(terminal, match, match_quark,
-					     params, vte_sequence_handler_scroll_up_one);
+	long val = 1;
+	GValue *value;
+
+	if ((params != NULL) && (params->n_values > 0)) {
+		value = g_value_array_get_nth(params, 0);
+		if (G_VALUE_HOLDS_LONG(value)) {
+			val = g_value_get_long(value);
+			val = MAX(val, 1);
+		}
+	}
+
+	_vte_terminal_scroll (terminal, -val);
+	return FALSE;
 }
 
 /* Standout end. */



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