[vte/vte-next: 152/223] Move {raise, lower, refresh, restore, maximize}-window signals to VteBuffer
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 152/223] Move {raise, lower, refresh, restore, maximize}-window signals to VteBuffer
- Date: Wed, 22 Jun 2011 21:01:22 +0000 (UTC)
commit f2c22ab68c934a46c9866c5446942c86f732342d
Author: Christian Persch <chpe gnome org>
Date: Sat Jun 11 17:30:47 2011 +0200
Move {raise,lower,refresh,restore,maximize}-window signals to VteBuffer
src/vte-private.h | 5 +
src/vte.c | 215 +++++++++++++++++++++++++++++++++--------------------
src/vte.h | 5 -
src/vteapp.c | 25 +++---
src/vtebuffer.h | 5 +
src/vteseq.c | 57 ++-------------
6 files changed, 164 insertions(+), 148 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 021b0fe..8f67245 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -484,6 +484,11 @@ gboolean _vte_buffer_insert_char(VteBuffer *buffer, gunichar c,
gboolean invalidate_cells);
void _vte_buffer_emit_deiconify_window(VteBuffer *buffer);
void _vte_buffer_emit_iconify_window(VteBuffer *buffer);
+void _vte_buffer_emit_raise_window(VteBuffer *buffer);
+void _vte_buffer_emit_lower_window(VteBuffer *buffer);
+void _vte_buffer_emit_refresh_window(VteBuffer *buffer);
+void _vte_buffer_emit_restore_window(VteBuffer *buffer);
+void _vte_buffer_emit_maximize_window(VteBuffer *buffer);
/* private VteScreen methods */
void _vte_screen_set_default_attributes(VteScreen *screen);
diff --git a/src/vte.c b/src/vte.c
index ed616bb..e0e7907 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -173,6 +173,11 @@ enum {
BUFFER_CHILD_EXITED,
BUFFER_DEICONIFY_WINDOW,
BUFFER_ICONIFY_WINDOW,
+ BUFFER_RAISE_WINDOW,
+ BUFFER_LOWER_WINDOW,
+ BUFFER_REFRESH_WINDOW,
+ BUFFER_RESTORE_WINDOW,
+ BUFFER_MAXIMIZE_WINDOW,
LAST_BUFFER_SIGNAL,
};
@@ -1048,6 +1053,51 @@ _vte_buffer_emit_iconify_window(VteBuffer *buffer)
g_signal_emit(buffer, buffer_signals[BUFFER_ICONIFY_WINDOW], 0);
}
+/* Emit a "raise-window" signal. */
+void
+_vte_buffer_emit_raise_window(VteBuffer *buffer)
+{
+ _vte_debug_print(VTE_DEBUG_SIGNALS,
+ "Emitting `raise-window'.\n");
+ g_signal_emit(buffer, buffer_signals[BUFFER_RAISE_WINDOW], 0);
+}
+
+/* Emit a "lower-window" signal. */
+void
+_vte_buffer_emit_lower_window(VteBuffer *buffer)
+{
+ _vte_debug_print(VTE_DEBUG_SIGNALS,
+ "Emitting `lower-window'.\n");
+ g_signal_emit(buffer, buffer_signals[BUFFER_LOWER_WINDOW], 0);
+}
+
+/* Emit a "maximize-window" signal. */
+void
+_vte_buffer_emit_maximize_window(VteBuffer *buffer)
+{
+ _vte_debug_print(VTE_DEBUG_SIGNALS,
+ "Emitting `maximize-window'.\n");
+ g_signal_emit(buffer, buffer_signals[BUFFER_MAXIMIZE_WINDOW], 0);
+}
+
+/* Emit a "refresh-window" signal. */
+void
+_vte_buffer_emit_refresh_window(VteBuffer *buffer)
+{
+ _vte_debug_print(VTE_DEBUG_SIGNALS,
+ "Emitting `refresh-window'.\n");
+ g_signal_emit(buffer, buffer_signals[BUFFER_REFRESH_WINDOW], 0);
+}
+
+/* Emit a "restore-window" signal. */
+void
+_vte_buffer_emit_restore_window(VteBuffer *buffer)
+{
+ _vte_debug_print(VTE_DEBUG_SIGNALS,
+ "Emitting `restore-window'.\n");
+ g_signal_emit(buffer, buffer_signals[BUFFER_RESTORE_WINDOW], 0);
+}
+
/* Deselect anything which is selected and refresh the screen if needed. */
static void
vte_terminal_deselect_all(VteTerminal *terminal)
@@ -10863,11 +10913,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
klass->contents_changed = NULL;
klass->cursor_moved = NULL;
- klass->raise_window = NULL;
- klass->lower_window = NULL;
- klass->refresh_window = NULL;
- klass->restore_window = NULL;
- klass->maximize_window = NULL;
klass->resize_window = NULL;
klass->move_window = NULL;
@@ -10958,81 +11003,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
G_TYPE_NONE, 0);
/**
- * VteTerminal::raise-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("raise-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, raise_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::lower-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("lower-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, lower_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::refresh-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("refresh-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, refresh_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::restore-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("restore-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, restore_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
- * VteTerminal::maximize-window:
- * @vteterminal: the object which received the signal
- *
- * Emitted at the child application's request.
- */
- g_signal_new(I_("maximize-window"),
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(VteTerminalClass, maximize_window),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- /**
* VteTerminal::resize-window:
* @vteterminal: the object which received the signal
* @width: the desired width in pixels, including padding
@@ -13591,6 +13561,11 @@ vte_buffer_class_init(VteBufferClass *klass)
klass->status_line_changed = NULL;
klass->deiconify_window = NULL;
klass->iconify_window = NULL;
+ klass->raise_window = NULL;
+ klass->lower_window = NULL;
+ klass->refresh_window = NULL;
+ klass->restore_window = NULL;
+ klass->maximize_window = NULL;
/**
* VteBuffer::child-exited:
@@ -13766,6 +13741,86 @@ vte_buffer_class_init(VteBufferClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ /**
+ * VteBuffer::raise-window:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ buffer_signals[BUFFER_RAISE_WINDOW] =
+ g_signal_new(I_("raise-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, raise_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteBuffer::lower-window:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ buffer_signals[BUFFER_LOWER_WINDOW] =
+ g_signal_new(I_("lower-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, lower_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteBuffer::refresh-window:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ buffer_signals[BUFFER_REFRESH_WINDOW] =
+ g_signal_new(I_("refresh-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, refresh_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteBuffer::restore-window:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ buffer_signals[BUFFER_RESTORE_WINDOW] =
+ g_signal_new(I_("restore-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, restore_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * VteBuffer::maximize-window:
+ * @vtebuffer: the object which received the signal
+ *
+ * Emitted at the child application's request.
+ */
+ buffer_signals[BUFFER_MAXIMIZE_WINDOW] =
+ g_signal_new(I_("maximize-window"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteBufferClass, maximize_window),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
/* Properties */
/**
diff --git a/src/vte.h b/src/vte.h
index 2b8fde3..385ac21 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -79,11 +79,6 @@ struct _VteTerminalClass {
void (*contents_changed)(VteTerminal* terminal);
void (*cursor_moved)(VteTerminal* terminal);
- void (*raise_window)(VteTerminal* terminal);
- void (*lower_window)(VteTerminal* terminal);
- void (*refresh_window)(VteTerminal* terminal);
- void (*restore_window)(VteTerminal* terminal);
- void (*maximize_window)(VteTerminal* terminal);
void (*resize_window)(VteTerminal* terminal, guint width, guint height);
void (*move_window)(VteTerminal* terminal, guint x, guint y);
diff --git a/src/vteapp.c b/src/vteapp.c
index b85f9c3..a13097d 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -226,7 +226,7 @@ deiconify_window(VteBuffer *buffer, gpointer data)
}
static void
-raise_window(GtkWidget *widget, gpointer data)
+raise_window(VteBuffer *buffer, gpointer data)
{
GdkWindow *window;
@@ -239,7 +239,7 @@ raise_window(GtkWidget *widget, gpointer data)
}
static void
-lower_window(GtkWidget *widget, gpointer data)
+lower_window(VteBuffer *buffer, gpointer data)
{
GdkWindow *window;
@@ -252,7 +252,7 @@ lower_window(GtkWidget *widget, gpointer data)
}
static void
-maximize_window(GtkWidget *widget, gpointer data)
+maximize_window(VteBuffer *buffer, gpointer data)
{
GdkWindow *window;
@@ -265,7 +265,7 @@ maximize_window(GtkWidget *widget, gpointer data)
}
static void
-restore_window(GtkWidget *widget, gpointer data)
+restore_window(VteBuffer *buffer, gpointer data)
{
GdkWindow *window;
@@ -278,16 +278,17 @@ restore_window(GtkWidget *widget, gpointer data)
}
static void
-refresh_window(GtkWidget *widget, gpointer data)
+refresh_window(VteBuffer *buffer, gpointer data)
{
GdkWindow *window;
GtkAllocation allocation;
cairo_rectangle_int_t rect;
+ /* FIXMEchpe: VteTerminal already does invalidate-all here! */
if (GTK_IS_WIDGET(data)) {
- window = gtk_widget_get_window(widget);
+ window = gtk_widget_get_window(GTK_WIDGET(data));
if (window) {
- gtk_widget_get_allocation(widget, &allocation);
+ gtk_widget_get_allocation(data, &allocation);
rect.x = rect.y = 0;
rect.width = allocation.width;
rect.height = allocation.height;
@@ -984,15 +985,15 @@ main(int argc, char **argv)
G_CALLBACK(iconify_window), window);
g_signal_connect(buffer, "deiconify-window",
G_CALLBACK(deiconify_window), window);
- g_signal_connect(widget, "raise-window",
+ g_signal_connect(buffer, "raise-window",
G_CALLBACK(raise_window), window);
- g_signal_connect(widget, "lower-window",
+ g_signal_connect(buffer, "lower-window",
G_CALLBACK(lower_window), window);
- g_signal_connect(widget, "maximize-window",
+ g_signal_connect(buffer, "maximize-window",
G_CALLBACK(maximize_window), window);
- g_signal_connect(widget, "restore-window",
+ g_signal_connect(buffer, "restore-window",
G_CALLBACK(restore_window), window);
- g_signal_connect(widget, "refresh-window",
+ g_signal_connect(buffer, "refresh-window",
G_CALLBACK(refresh_window), window);
g_signal_connect(widget, "resize-window",
G_CALLBACK(resize_window), window);
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index b36606d..e19d9e3 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -57,6 +57,11 @@ struct _VteBufferClass {
gint status);
void (*deiconify_window) (VteBuffer* buffer);
void (*iconify_window) (VteBuffer* buffer);
+ void (*raise_window) (VteBuffer* buffer);
+ void (*lower_window) (VteBuffer* buffer);
+ void (*refresh_window) (VteBuffer* buffer);
+ void (*restore_window) (VteBuffer* buffer);
+ void (*maximize_window) (VteBuffer* buffer);
/*< private >*/
VteBufferClassPrivate *priv;
diff --git a/src/vteseq.c b/src/vteseq.c
index b5b0449..7e6cd2b 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -179,51 +179,6 @@ vte_parse_color (const char *spec, GdkRGBA *rgba)
return TRUE;
}
-/* Emit a "raise-window" signal. */
-static void
-vte_terminal_emit_raise_window(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS,
- "Emitting `raise-window'.\n");
- g_signal_emit_by_name(terminal, "raise-window");
-}
-
-/* Emit a "lower-window" signal. */
-static void
-vte_terminal_emit_lower_window(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS,
- "Emitting `lower-window'.\n");
- g_signal_emit_by_name(terminal, "lower-window");
-}
-
-/* Emit a "maximize-window" signal. */
-static void
-vte_terminal_emit_maximize_window(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS,
- "Emitting `maximize-window'.\n");
- g_signal_emit_by_name(terminal, "maximize-window");
-}
-
-/* Emit a "refresh-window" signal. */
-static void
-vte_terminal_emit_refresh_window(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS,
- "Emitting `refresh-window'.\n");
- g_signal_emit_by_name(terminal, "refresh-window");
-}
-
-/* Emit a "restore-window" signal. */
-static void
-vte_terminal_emit_restore_window(VteTerminal *terminal)
-{
- _vte_debug_print(VTE_DEBUG_SIGNALS,
- "Emitting `restore-window'.\n");
- g_signal_emit_by_name(terminal, "restore-window");
-}
-
/* Emit a "move-window" signal. (Pixels.) */
static void
vte_terminal_emit_move_window(VteTerminal *terminal, guint x, guint y)
@@ -1862,7 +1817,7 @@ vte_sequence_handler_change_color (VteTerminal *terminal, GValueArray *params)
/* emit the refresh as the palette has changed and previous
* renders need to be updated. */
- vte_terminal_emit_refresh_window (terminal);
+ _vte_buffer_emit_refresh_window (terminal->term_pvt->buffer);
}
}
@@ -3107,17 +3062,17 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
break;
case 5:
_vte_debug_print(VTE_DEBUG_PARSE, "Raising window.\n");
- vte_terminal_emit_raise_window(terminal);
+ _vte_buffer_emit_raise_window(terminal->term_pvt->buffer);
break;
case 6:
_vte_debug_print(VTE_DEBUG_PARSE, "Lowering window.\n");
- vte_terminal_emit_lower_window(terminal);
+ _vte_buffer_emit_lower_window(terminal->term_pvt->buffer);
break;
case 7:
_vte_debug_print(VTE_DEBUG_PARSE,
"Refreshing window.\n");
_vte_invalidate_all(terminal);
- vte_terminal_emit_refresh_window(terminal);
+ _vte_buffer_emit_refresh_window(terminal->term_pvt->buffer);
break;
case 8:
if ((arg1 != -1) && (arg2 != -1)) {
@@ -3140,12 +3095,12 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
case 0:
_vte_debug_print(VTE_DEBUG_PARSE,
"Restoring window.\n");
- vte_terminal_emit_restore_window(terminal);
+ _vte_buffer_emit_restore_window(terminal->term_pvt->buffer);
break;
case 1:
_vte_debug_print(VTE_DEBUG_PARSE,
"Maximizing window.\n");
- vte_terminal_emit_maximize_window(terminal);
+ _vte_buffer_emit_maximize_window(terminal->term_pvt->buffer);
break;
default:
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]