[vte] widget: Move some methods to VteTerminalPrivate
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Move some methods to VteTerminalPrivate
- Date: Sat, 28 Nov 2015 21:58:55 +0000 (UTC)
commit 935b8c5e13e641fc1c47cd4770297b8d9fa24b9b
Author: Christian Persch <chpe gnome org>
Date: Sat Nov 28 22:58:31 2015 +0100
widget: Move some methods to VteTerminalPrivate
src/vte-private.h | 2 --
src/vte.cc | 16 +++++++---------
src/vteaccess.cc | 32 ++++++++++++++++----------------
src/vteinternal.hh | 2 ++
4 files changed, 25 insertions(+), 27 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index e51a41b..7e6f10e 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -128,8 +128,6 @@ gboolean _vte_terminal_size_to_grid_size(VteTerminal *terminal,
long *cols,
long *rows);
-gboolean _vte_terminal_is_word_char(VteTerminal *terminal, gunichar c);
-
static inline bool
_vte_double_equal(double a,
double b)
diff --git a/src/vte.cc b/src/vte.cc
index e8f0fcf..e43ea12 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5242,17 +5242,15 @@ static const guint8 word_char_by_category[] = {
};
/*
- * _vte_terminal_is_word_char:
- * @terminal: a #VteTerminal
+ * VteTerminalPrivate::is_word_char:
* @c: a candidate Unicode code point
*
* Checks if a particular character is considered to be part of a word or not.
*
* Returns: %TRUE if the character is considered to be part of a word
*/
-gboolean
-_vte_terminal_is_word_char(VteTerminal *terminal,
- gunichar c)
+bool
+VteTerminalPrivate::is_word_char(gunichar c) const
{
const guint8 v = word_char_by_category[g_unichar_type(c)];
@@ -5261,8 +5259,8 @@ _vte_terminal_is_word_char(VteTerminal *terminal,
/* Do we have an exception? */
return bsearch(&c,
- terminal->pvt->word_char_exceptions,
- terminal->pvt->word_char_exceptions_len,
+ m_word_char_exceptions,
+ m_word_char_exceptions_len,
sizeof(gunichar),
compare_unichar_p) != NULL;
}
@@ -5276,7 +5274,7 @@ vte_same_class(VteTerminal *terminal, glong acol, glong arow,
const VteCell *pcell = NULL;
gboolean word_char;
if ((pcell = vte_terminal_find_charcell(terminal, acol, arow)) != NULL && pcell->c != 0) {
- word_char = _vte_terminal_is_word_char(terminal, _vte_unistr_get_base (pcell->c));
+ word_char = terminal->pvt->is_word_char(_vte_unistr_get_base (pcell->c));
/* Lets not group non-wordchars together (bug #25290) */
if (!word_char)
@@ -5286,7 +5284,7 @@ vte_same_class(VteTerminal *terminal, glong acol, glong arow,
if (pcell == NULL || pcell->c == 0) {
return FALSE;
}
- if (word_char != _vte_terminal_is_word_char(terminal, _vte_unistr_get_base (pcell->c))) {
+ if (word_char != terminal->pvt->is_word_char(_vte_unistr_get_base (pcell->c))) {
return FALSE;
}
return TRUE;
diff --git a/src/vteaccess.cc b/src/vteaccess.cc
index d90817f..d739652 100644
--- a/src/vteaccess.cc
+++ b/src/vteaccess.cc
@@ -946,7 +946,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
/* Back up to the previous non-word-word transition. */
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset - 1);
- if (_vte_terminal_is_word_char(terminal, prev)) {
+ if (terminal->pvt->is_word_char(prev)) {
offset--;
} else {
break;
@@ -960,7 +960,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
if (direction == direction_previous) {
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset -
1);
- if (!_vte_terminal_is_word_char(terminal, prev)) {
+ if (!terminal->pvt->is_word_char(prev)) {
offset--;
} else {
break;
@@ -968,7 +968,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
}
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset -
1);
- if (_vte_terminal_is_word_char(terminal, prev)) {
+ if (terminal->pvt->is_word_char(prev)) {
offset--;
} else {
break;
@@ -983,7 +983,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
if (direction == direction_next) {
while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (_vte_terminal_is_word_char(terminal, next)) {
+ if (terminal->pvt->is_word_char(next)) {
offset++;
} else {
break;
@@ -991,7 +991,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
}
while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (!_vte_terminal_is_word_char(terminal, next)) {
+ if (!terminal->pvt->is_word_char(next)) {
offset++;
} else {
break;
@@ -1002,7 +1002,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
/* Now find the end of this word. */
while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (_vte_terminal_is_word_char(terminal, current)) {
+ if (terminal->pvt->is_word_char(current)) {
offset++;
} else {
break;
@@ -1012,7 +1012,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
/* Now find the next non-word-word transition */
while (offset < (int) priv->snapshot_characters->len) {
next = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (!_vte_terminal_is_word_char(terminal, next)) {
+ if (!terminal->pvt->is_word_char(next)) {
offset++;
} else {
break;
@@ -1025,8 +1025,8 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
current = vte_terminal_accessible_get_character_at_offset(text, offset);
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset - 1);
- if (_vte_terminal_is_word_char(terminal, prev) &&
- !_vte_terminal_is_word_char(terminal, current)) {
+ if (terminal->pvt->is_word_char(prev) &&
+ !terminal->pvt->is_word_char(current)) {
break;
} else {
offset--;
@@ -1041,7 +1041,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
if (direction == direction_previous) {
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset -
1);
- if (_vte_terminal_is_word_char(terminal, prev)) {
+ if (terminal->pvt->is_word_char(prev)) {
offset--;
} else {
break;
@@ -1050,8 +1050,8 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
current = vte_terminal_accessible_get_character_at_offset(text, offset);
while (offset > 0) {
prev = vte_terminal_accessible_get_character_at_offset(text, offset -
1);
- if (_vte_terminal_is_word_char(terminal, prev) &&
- !_vte_terminal_is_word_char(terminal, current)) {
+ if (terminal->pvt->is_word_char(prev) &&
+ !terminal->pvt->is_word_char(current)) {
break;
} else {
offset--;
@@ -1067,7 +1067,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
if (direction == direction_next) {
while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text,
offset);
- if (!_vte_terminal_is_word_char(terminal, current)) {
+ if (!terminal->pvt->is_word_char(current)) {
offset++;
} else {
break;
@@ -1075,7 +1075,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
}
while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text,
offset);
- if (_vte_terminal_is_word_char(terminal, current)) {
+ if (terminal->pvt->is_word_char(current)) {
offset++;
} else {
break;
@@ -1086,7 +1086,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
/* Now find the next word end. */
while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (!_vte_terminal_is_word_char(terminal, current)) {
+ if (!terminal->pvt->is_word_char(current)) {
offset++;
} else {
break;
@@ -1094,7 +1094,7 @@ vte_terminal_accessible_get_text_somewhere(AtkText *text,
}
while (offset < (int) priv->snapshot_characters->len) {
current = vte_terminal_accessible_get_character_at_offset(text, offset);
- if (_vte_terminal_is_word_char(terminal, current)) {
+ if (terminal->pvt->is_word_char(current)) {
offset++;
} else {
break;
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 59e8b65..a7d6137 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -535,6 +535,8 @@ public:
void feed_child_binary(guint8 const* data,
gsize length);
+ bool is_word_char(gunichar c) const;
+
void start_selection(long x,
long y,
enum vte_selection_type selection_type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]