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



commit 33fd0f1f9a2f672f6e791b3675552e79d0e7492e
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         |   41 ++++++++++-------------------------------
 src/vtegtk.cc      |   31 +++++++++++++++++++++++++++++++
 src/vteinternal.hh |    3 +++
 3 files changed, 44 insertions(+), 31 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 6a20dab..22327e3 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -1968,50 +1968,29 @@ rowcol_inside_match (VteTerminal *terminal, glong row, glong col)
        }
 }
 
-/**
- * vte_terminal_match_check:
- * @terminal: a #VteTerminal
- * @column: the text column
- * @row: the text row
- * @tag: (out) (allow-none): a location to store the tag, or %NULL
- *
- * Checks if the text in and around the specified position 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
- *
- * Deprecated: 0.44: Use vte_terminal_match_check_event() instead.
- */
 char *
-vte_terminal_match_check(VteTerminal *terminal, glong column, glong row,
-                        int *tag)
+VteTerminalPrivate::regex_match_check(vte::grid::column_t column,
+                                      vte::grid::row_t row,
+                                      int *tag)
 {
-       long delta;
        char *ret;
-       g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
-       delta = terminal->pvt->screen->scroll_delta;
+
+       long delta = m_screen->scroll_delta;
        _vte_debug_print(VTE_DEBUG_EVENTS | VTE_DEBUG_REGEX,
                        "Checking for match at (%ld,%ld).\n",
                        row, column);
-       if (rowcol_inside_match (terminal, row + delta, column)) {
+       if (rowcol_inside_match(m_terminal, row + delta, column)) {
                if (tag) {
-                       *tag = terminal->pvt->match_tag;
+                       *tag = m_match_tag;
                }
-               ret = terminal->pvt->match != NULL ?
-                       g_strdup (terminal->pvt->match) :
+               ret = m_match != NULL ?
+                       g_strdup (m_match) :
                        NULL;
        } else {
                 gsize start, end;
                 int ltag;
 
-               ret = terminal->pvt->match_check_internal(
+               ret = match_check_internal(
                                                         column, row + delta,
                                                         tag ? tag : &ltag,
                                                         &start, &end);
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index bf093c7..c684ab7 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -1651,6 +1651,37 @@ vte_terminal_match_add_regex(VteTerminal *terminal,
 }
 
 /**
+ * vte_terminal_match_check:
+ * @terminal: a #VteTerminal
+ * @column: the text column
+ * @row: the text row
+ * @tag: (out) (allow-none): a location to store the tag, or %NULL
+ *
+ * Checks if the text in and around the specified position 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
+ *
+ * Deprecated: 0.44: Use vte_terminal_match_check_event() instead.
+ */
+char *
+vte_terminal_match_check(VteTerminal *terminal,
+                         long column,
+                         long row,
+                        int *tag)
+{
+        g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
+        return terminal->pvt->regex_match_check(column, row, tag);
+}
+
+/**
  * vte_terminal_match_set_cursor:
  * @terminal: a #VteTerminal
  * @tag: the tag of the regex which should use the specified cursor
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 0b38cdb..17e0e98 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -513,6 +513,9 @@ public:
 
         int regex_match_add(struct vte_match_regex *new_regex_match);
         struct vte_match_regex *regex_match_get(int tag);
+        char *regex_match_check(vte::grid::column_t column,
+                                vte::grid::row_t row,
+                                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]