[vte] widget: Move some public API to its own file



commit 4133cc643fa27bd3cd2f291d6f6b02077572130a
Author: Christian Persch <chpe gnome org>
Date:   Wed Nov 18 21:15:46 2015 +0100

    widget: Move some public API to its own file

 src/vte.cc         |   31 +++++--------------------------
 src/vtegtk.cc      |   28 ++++++++++++++++++++++++++++
 src/vteinternal.hh |    2 ++
 3 files changed, 35 insertions(+), 26 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 22327e3..addc386 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -2027,38 +2027,17 @@ rowcol_from_event(VteTerminal *terminal,
         return TRUE;
 }
 
-/**
- * vte_terminal_match_check_event:
- * @terminal: a #VteTerminal
- * @event: a #GdkEvent
- * @tag: (out) (allow-none): a location to store the tag, or %NULL
- *
- * Checks if the text in and around the position of the event matches any of the
- * regular expressions previously set using vte_terminal_match_add().  If a
- * match exists, the text string is returned and if @tag is not %NULL, the number
- * associated with the matched regular expression will be stored in @tag.
- *
- * If more than one regular expression has been set with
- * vte_terminal_match_add(), then expressions are checked in the order in
- * which they were added.
- *
- * Returns: (transfer full): a newly allocated string which matches one of the previously
- *   set regular expressions
- */
 char *
-vte_terminal_match_check_event(VteTerminal *terminal,
-                               GdkEvent *event,
-                               int *tag)
+VteTerminalPrivate::regex_match_check(GdkEvent *event,
+                                      int *tag)
 {
         long col, row;
-
-        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
-
-        if (!rowcol_from_event(terminal, event, &col, &row))
+        if (!rowcol_from_event(m_terminal, event, &col, &row))
                 return FALSE;
 
         /* FIXME Shouldn't rely on a deprecated, not sub-row aware method. */
-        return vte_terminal_match_check(terminal, col, row - (long) terminal->pvt->screen->scroll_delta, 
tag);
+        // FIXMEchpe fix this scroll_delta substraction!
+        return regex_match_check(col, row - (long)m_screen->scroll_delta, tag);
 }
 
 /**
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index c684ab7..cab92ac 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -1681,6 +1681,34 @@ vte_terminal_match_check(VteTerminal *terminal,
         return terminal->pvt->regex_match_check(column, row, tag);
 }
 
+
+/**
+ * vte_terminal_match_check_event:
+ * @terminal: a #VteTerminal
+ * @event: a #GdkEvent
+ * @tag: (out) (allow-none): a location to store the tag, or %NULL
+ *
+ * Checks if the text in and around the position of the event matches any of the
+ * regular expressions previously set using vte_terminal_match_add().  If a
+ * match exists, the text string is returned and if @tag is not %NULL, the number
+ * associated with the matched regular expression will be stored in @tag.
+ *
+ * If more than one regular expression has been set with
+ * vte_terminal_match_add(), then expressions are checked in the order in
+ * which they were added.
+ *
+ * Returns: (transfer full): a newly allocated string which matches one of the previously
+ *   set regular expressions
+ */
+char *
+vte_terminal_match_check_event(VteTerminal *terminal,
+                               GdkEvent *event,
+                               int *tag)
+{
+        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), FALSE);
+        return terminal->pvt->regex_match_check(event, tag);
+}
+
 /**
  * vte_terminal_match_set_cursor:
  * @terminal: a #VteTerminal
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 17e0e98..f310eb1 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -516,6 +516,8 @@ public:
         char *regex_match_check(vte::grid::column_t column,
                                 vte::grid::row_t row,
                                 int *tag);
+        char *regex_match_check(GdkEvent *event,
+                                int *tag);
         void regex_match_remove(int tag);
         void regex_match_remove_all();
         void regex_match_set_cursor(int tag,


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