[vte/vte-next: 147/223] Move status-line to VteBuffer
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 147/223] Move status-line to VteBuffer
- Date: Wed, 22 Jun 2011 21:00:57 +0000 (UTC)
commit d59f080029b6454353cb6496aa162586abfa80ed
Author: Christian Persch <chpe gnome org>
Date: Sat Jun 11 16:11:47 2011 +0200
Move status-line to VteBuffer
doc/reference/vte-sections.txt | 2 +-
src/vte.c | 59 ++++++++++++++++++++-------------------
src/vte.h | 4 ---
src/vteapp.c | 6 ++--
src/vtebuffer.h | 3 ++
5 files changed, 37 insertions(+), 37 deletions(-)
---
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 6acf5f1..ea4bfed 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -42,7 +42,6 @@ vte_terminal_match_check
vte_terminal_match_set_cursor
vte_terminal_match_set_cursor_type
vte_terminal_match_set_cursor_name
-vte_terminal_get_status_line
vte_terminal_search_find_next
vte_terminal_search_find_previous
vte_terminal_search_get_gregex
@@ -113,6 +112,7 @@ vte_buffer_feed_child_binary
vte_buffer_reset
vte_buffer_get_icon_title
vte_buffer_get_window_title
+vte_buffer_get_status_line
vte_buffer_write_contents_sync
<SUBSECTION Standard>
diff --git a/src/vte.c b/src/vte.c
index bfa4d92..d503ae6 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -168,6 +168,7 @@ enum {
BUFFER_ENCODING_CHANGED,
BUFFER_WINDOW_TITLE_CHANGED,
BUFFER_ICON_TITLE_CHANGED,
+ BUFFER_STATUS_LINE_CHANGED,
LAST_BUFFER_SIGNAL,
};
@@ -951,12 +952,11 @@ vte_terminal_emit_char_size_changed(VteTerminal *terminal,
/* Emit a "status-line-changed" signal. */
static void
-_vte_terminal_emit_status_line_changed(VteTerminal *terminal)
+_vte_buffer_emit_status_line_changed(VteBuffer *buffer)
{
_vte_debug_print(VTE_DEBUG_SIGNALS,
"Emitting `status-line-changed'.\n");
- g_signal_emit_by_name(terminal, "status-line-changed");
-/* g_object_notify(G_OBJECT(terminal), "status-line"); */
+ g_signal_emit(buffer, buffer_signals[BUFFER_STATUS_LINE_CHANGED], 0);
}
/* Emit an "increase-font-size" signal. */
@@ -10836,7 +10836,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
klass->selection_changed = NULL;
klass->contents_changed = NULL;
klass->cursor_moved = NULL;
- klass->status_line_changed = NULL;
klass->deiconify_window = NULL;
klass->iconify_window = NULL;
@@ -11109,22 +11108,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
/**
- * VteTerminal::status-line-changed:
- * @vteterminal: the object which received the signal
- *
- * Emitted whenever the contents of the status line are modified or
- * cleared.
- */
- g_signal_new(I_("status-line-changed"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, status_line_changed),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
* VteTerminal::increase-font-size:
* @vteterminal: the object which received the signal
*
@@ -12352,22 +12335,22 @@ vte_buffer_reset(VteBuffer *buffer,
}
/**
- * vte_terminal_get_status_line:
- * @terminal: a #VteTerminal
+ * vte_buffer_get_status_line:
+ * @buffer: a #VteBuffer
*
- * Some terminal emulations specify a status line which is separate from the
+ * Some buffer emulations specify a status line which is separate from the
* main display area, and define a means for applications to move the cursor
* to the status line and back.
*
- * Returns: (transfer none): the current contents of the terminal's status line.
- * For terminals like "xterm", this will usually be the empty string. The string
+ * Returns: (transfer none): the current contents of the buffer's status line.
+ * For buffers like "xterm", this will usually be the empty string. The string
* must not be modified or freed by the caller.
*/
const char *
-vte_terminal_get_status_line(VteTerminal *terminal)
+vte_buffer_get_status_line(VteBuffer *buffer)
{
- g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL);
- return terminal->pvt->screen->status_line_contents->str;
+ g_return_val_if_fail(VTE_IS_BUFFER(buffer), NULL);
+ return buffer->pvt->screen->status_line_contents->str;
}
/**
@@ -12807,7 +12790,7 @@ vte_terminal_emit_pending_signals(VteTerminal *terminal)
vte_terminal_emit_adjustment_changed (terminal);
if (terminal->pvt->screen->status_line_changed) {
- _vte_terminal_emit_status_line_changed (terminal);
+ _vte_buffer_emit_status_line_changed (terminal->term_pvt->buffer);
terminal->pvt->screen->status_line_changed = FALSE;
}
@@ -13645,6 +13628,7 @@ vte_buffer_class_init(VteBufferClass *klass)
klass->encoding_changed = NULL;
klass->window_title_changed = NULL;
klass->icon_title_changed = NULL;
+ klass->status_line_changed = NULL;
/**
* VteBuffer::commit:
@@ -13734,6 +13718,23 @@ vte_buffer_class_init(VteBufferClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * VteBuffer::status-line-changed:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted whenever the contents of the status line are modified or
+ * cleared.
+ */
+ buffer_signals[BUFFER_STATUS_LINE_CHANGED] =
+ g_signal_new(I_("status-line-changed"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, status_line_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/* Properties */
/**
diff --git a/src/vte.h b/src/vte.h
index 9ce3c30..be5b1ac 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -81,7 +81,6 @@ struct _VteTerminalClass {
void (*selection_changed)(VteTerminal* terminal);
void (*contents_changed)(VteTerminal* terminal);
void (*cursor_moved)(VteTerminal* terminal);
- void (*status_line_changed)(VteTerminal* terminal);
void (*deiconify_window)(VteTerminal* terminal);
void (*iconify_window)(VteTerminal* terminal);
@@ -263,9 +262,6 @@ gboolean vte_terminal_search_find_next (VteTerminal *terminal);
const char *vte_get_default_emulation(void);
-/* Get the contents of the status line. */
-const char *vte_terminal_get_status_line(VteTerminal *terminal);
-
void vte_terminal_set_pty(VteTerminal *terminal, VtePty *pty);
VtePty *vte_terminal_get_pty(VteTerminal *terminal);
diff --git a/src/vteapp.c b/src/vteapp.c
index 41a5fe6..6b2d9d7 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -169,10 +169,10 @@ child_exited(GtkWidget *terminal, int status, gpointer window)
}
static void
-status_line_changed(GtkWidget *widget, gpointer data)
+status_line_changed(VteBuffer *buffer, gpointer data)
{
g_print("Status = `%s'.\n",
- vte_terminal_get_status_line(VTE_TERMINAL(widget)));
+ vte_buffer_get_status_line(buffer));
}
static int
@@ -968,7 +968,7 @@ main(int argc, char **argv)
}
/* Connect to the "status-line-changed" signal. */
- g_signal_connect(widget, "status-line-changed",
+ g_signal_connect(buffer, "status-line-changed",
G_CALLBACK(status_line_changed), widget);
/* Connect to the "button-press" event. */
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index 26ca497..6e1789f 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -51,6 +51,7 @@ struct _VteBufferClass {
void (*encoding_changed) (VteBuffer *buffer);
void (*icon_title_changed) (VteBuffer* buffer);
void (*window_title_changed) (VteBuffer* buffer);
+ void (*status_line_changed) (VteBuffer* buffer);
/*< private >*/
VteBufferClassPrivate *priv;
@@ -104,6 +105,8 @@ const char *vte_buffer_get_window_title (VteBuffer *buffer);
const char *vte_buffer_get_icon_title (VteBuffer *buffer);
+const char *vte_buffer_get_status_line (VteBuffer *buffer);
+
gboolean vte_buffer_write_contents_sync (VteBuffer *buffer,
GOutputStream *stream,
VteWriteFlags flags,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]