[vte/vte-next: 121/223] Move method to VteScreen
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 121/223] Move method to VteScreen
- Date: Wed, 22 Jun 2011 20:58:46 +0000 (UTC)
commit 0bbf4279719d57f7bb5b6c5c786196269de508cf
Author: Christian Persch <chpe gnome org>
Date: Thu Jun 9 14:13:56 2011 +0200
Move method to VteScreen
src/vte-private.h | 4 +++-
src/vte.c | 24 ++++++++++--------------
src/vteseq.c | 6 +++---
3 files changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 0e5446f..beef2b0 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -441,7 +441,6 @@ gboolean _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
gboolean invalidate_cells);
void _vte_terminal_scroll_region(VteTerminal *terminal,
long row, glong count, glong delta);
-void _vte_terminal_set_default_attributes(VteTerminal *terminal);
void _vte_terminal_clear_tabstop(VteTerminal *terminal, int column);
gboolean _vte_terminal_get_tabstop(VteTerminal *terminal, int column);
void _vte_terminal_set_tabstop(VteTerminal *terminal, int column);
@@ -482,6 +481,9 @@ VteRowData *_vte_buffer_ring_insert (VteBuffer *buffer, glong position, gboolean
VteRowData *_vte_buffer_ring_append (VteBuffer *buffer, gboolean fill);
void _vte_buffer_ring_remove (VteBuffer *buffer, glong position);
+/* private VteScreen methods */
+void _vte_screen_set_default_attributes(VteScreen *screen);
+
G_END_DECLS
#endif
diff --git a/src/vte.c b/src/vte.c
index 144c11d..fa1d45a 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -327,12 +327,8 @@ _vte_buffer_ring_remove (VteBuffer *buffer,
/* Reset defaults for character insertion. */
void
-_vte_terminal_set_default_attributes(VteTerminal *terminal)
+_vte_screen_set_default_attributes(VteScreen *screen)
{
- VteScreen *screen;
-
- screen = terminal->pvt->screen;
-
screen->defaults = basic_cell.cell;
screen->color_defaults = screen->defaults;
screen->fill_defaults = screen->defaults;
@@ -7552,13 +7548,14 @@ vte_terminal_init(VteTerminal *terminal)
VteTerminalPrivate *pvt;
VteTerminalRealPrivate *term_pvt;
GtkStyleContext *context;
+ VteBuffer *buffer;
_vte_debug_print(VTE_DEBUG_LIFECYCLE, "vte_terminal_init()\n");
/* Initialize private data. */
term_pvt = terminal->term_pvt = G_TYPE_INSTANCE_GET_PRIVATE (terminal, VTE_TYPE_TERMINAL, VteTerminalRealPrivate);
- term_pvt->buffer = vte_buffer_new();
+ buffer = term_pvt->buffer = vte_buffer_new();
term_pvt->buffer_pvt = term_pvt->buffer->pvt;
pvt = terminal->pvt = term_pvt->buffer_pvt;
@@ -7596,14 +7593,14 @@ vte_terminal_init(VteTerminal *terminal)
_vte_ring_init (pvt->alternate_screen.row_data, terminal->pvt->row_count);
pvt->alternate_screen.sendrecv_mode = TRUE;
pvt->alternate_screen.status_line_contents = g_string_new(NULL);
- pvt->screen = &terminal->pvt->alternate_screen;
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(&pvt->alternate_screen);
_vte_ring_init (pvt->normal_screen.row_data, VTE_SCROLLBACK_INIT);
pvt->normal_screen.sendrecv_mode = TRUE;
pvt->normal_screen.status_line_contents = g_string_new(NULL);
- pvt->screen = &terminal->pvt->normal_screen;
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(&pvt->normal_screen);
+
+ pvt->screen = &pvt->normal_screen;
/* Set up I/O encodings. */
pvt->iso2022 = _vte_iso2022_state_new(pvt->encoding,
@@ -12407,10 +12404,9 @@ vte_terminal_reset(VteTerminal *terminal,
vte_terminal_update_style_colors(terminal, TRUE);
/* Reset the default attributes. Reset the alternate attribute because
* it's not a real attribute, but we need to treat it as one here. */
- pvt->screen = &pvt->alternate_screen;
- _vte_terminal_set_default_attributes(terminal);
- pvt->screen = &pvt->normal_screen;
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(&pvt->alternate_screen);
+ _vte_screen_set_default_attributes(&pvt->normal_screen);
+ pvt->screen = &pvt->normal_screen;
/* Reset alternate charset mode. */
pvt->normal_screen.alternate_charset = FALSE;
pvt->alternate_screen.alternate_charset = FALSE;
diff --git a/src/vteseq.c b/src/vteseq.c
index ed65c89..31cf446 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -1696,7 +1696,7 @@ vte_sequence_handler_md (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_me (VteTerminal *terminal, GValueArray *params)
{
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(terminal->pvt->screen);
}
/* Half-bright on. */
@@ -2283,7 +2283,7 @@ vte_sequence_handler_character_attributes (VteTerminal *terminal, GValueArray *p
param = g_value_get_long(value);
switch (param) {
case 0:
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(terminal->pvt->screen);
break;
case 1:
terminal->pvt->screen->defaults.attr.bold = 1;
@@ -2418,7 +2418,7 @@ vte_sequence_handler_character_attributes (VteTerminal *terminal, GValueArray *p
}
/* If we had no parameters, default to the defaults. */
if (i == 0) {
- _vte_terminal_set_default_attributes(terminal);
+ _vte_screen_set_default_attributes(terminal->pvt->screen);
}
/* Save the new colors. */
terminal->pvt->screen->color_defaults.attr.fore =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]