[vte/search] Add _[gs]et_wrap_around() API



commit ed1c3e4ba7aa3a6a3d4eea9dc30b6356f91c26b9
Author: Behdad Esfahbod <behdad behdad org>
Date:   Tue Apr 27 11:35:39 2010 -0400

    Add _[gs]et_wrap_around() API

 src/vte-private.h |    1 +
 src/vte.c         |   29 ++++++++++++++++++++++-------
 src/vte.h         |    7 ++++---
 3 files changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 595ee40..77ed099 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -319,6 +319,7 @@ struct _VteTerminalPrivate {
 
 	/* Search data. */
 	GRegex *search_regex;
+	gboolean *search_wrap_around;
 
 	/* Data used when rendering the text which does not require server
 	 * resources and which can be kept after unrealizing. */
diff --git a/src/vte.c b/src/vte.c
index 0be4118..90e973d 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -14560,21 +14560,37 @@ vte_terminal_search_set_gregex (VteTerminal *terminal,
 GRegex *
 vte_terminal_search_get_gregex (VteTerminal *terminal)
 {
-        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
 
 	return terminal->pvt->search_regex;
 }
 
+void
+vte_terminal_search_set_wrap_around (VteTerminal *terminal,
+				     gboolean     wrap_around)
+{
+	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+
+	terminal->pvt->search_wrap_around = !!wrap_around;
+}
+
 gboolean
-vte_terminal_search_find_previous (VteTerminal *terminal,
-				   gboolean     wrap_around)
+vte_terminal_search_get_wrap_around (VteTerminal *terminal)
+{
+	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+
+	return terminal->pvt->search_wrap_around;
+}
+
+gboolean
+vte_terminal_search_find_previous (VteTerminal *terminal)
 {
 	gboolean result = FALSE;
         VteTerminalPrivate *pvt;
 	GArray *attrs;
 	long row;
 
-        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), result);
+	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), result);
 
 	pvt = terminal->pvt;
 
@@ -14647,10 +14663,9 @@ vte_terminal_search_find_previous (VteTerminal *terminal,
 }
 
 gboolean
-vte_terminal_search_find_next (VteTerminal *terminal,
-			       gboolean     wrap_around)
+vte_terminal_search_find_next (VteTerminal *terminal)
 {
-        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+	g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
 
 	if (!terminal->pvt->search_regex)
 		return FALSE;
diff --git a/src/vte.h b/src/vte.h
index bed9857..9b32459 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -428,10 +428,11 @@ char *vte_terminal_match_check(VteTerminal *terminal,
 void      vte_terminal_search_set_gregex      (VteTerminal *terminal,
 					       GRegex      *regex);
 GRegex   *vte_terminal_search_get_gregex      (VteTerminal *terminal);
-gboolean  vte_terminal_search_find_previous   (VteTerminal *terminal,
-					       gboolean     wrap_around);
-gboolean  vte_terminal_search_find_next       (VteTerminal *terminal,
+void      vte_terminal_search_set_wrap_around (VteTerminal *terminal,
 					       gboolean     wrap_around);
+gboolean  vte_terminal_search_get_wrap_around (VteTerminal *terminal);
+gboolean  vte_terminal_search_find_previous   (VteTerminal *terminal);
+gboolean  vte_terminal_search_find_next       (VteTerminal *terminal);
 
 
 /* Set the emulation type.  Most of the time you won't need this. */



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