[vte/vte-next: 151/223] Move {de,}iconify signal to VteBuffer



commit ce19d9d0dfa69ed3a7dd3ed87a28269a10be44b4
Author: Christian Persch <chpe gnome org>
Date:   Sat Jun 11 17:17:01 2011 +0200

    Move {de,}iconify signal to VteBuffer

 src/vte-private.h |    2 +
 src/vte.c         |   86 +++++++++++++++++++++++++++++++++-------------------
 src/vte.h         |    2 -
 src/vteapp.c      |    8 ++--
 src/vtebuffer.h   |    2 +
 src/vteseq.c      |   22 +------------
 6 files changed, 64 insertions(+), 58 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index aeee782..021b0fe 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -482,6 +482,8 @@ void _vte_buffer_cursor_down (VteBuffer *buffer);
 gboolean _vte_buffer_insert_char(VteBuffer *buffer, gunichar c,
                                  gboolean force_insert_mode,
                                  gboolean invalidate_cells);
+void _vte_buffer_emit_deiconify_window(VteBuffer *buffer);
+void _vte_buffer_emit_iconify_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 575df7d..ed616bb 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -171,6 +171,8 @@ enum {
         BUFFER_STATUS_LINE_CHANGED,
         BUFFER_EOF,
         BUFFER_CHILD_EXITED,
+        BUFFER_DEICONIFY_WINDOW,
+        BUFFER_ICONIFY_WINDOW,
         LAST_BUFFER_SIGNAL,
 };
 
@@ -1028,6 +1030,24 @@ vte_terminal_emit_text_scrolled(VteTerminal *terminal, gint delta)
 	g_signal_emit_by_name(terminal, "text-scrolled", delta);
 }
 
+/* Emit a "deiconify-window" signal. */
+void
+_vte_buffer_emit_deiconify_window(VteBuffer *buffer)
+{
+        _vte_debug_print(VTE_DEBUG_SIGNALS,
+                        "Emitting `deiconify-window'.\n");
+        g_signal_emit(buffer, buffer_signals[BUFFER_DEICONIFY_WINDOW], 0);
+}
+
+/* Emit a "iconify-window" signal. */
+void
+_vte_buffer_emit_iconify_window(VteBuffer *buffer)
+{
+        _vte_debug_print(VTE_DEBUG_SIGNALS,
+                        "Emitting `iconify-window'.\n");
+        g_signal_emit(buffer, buffer_signals[BUFFER_ICONIFY_WINDOW], 0);
+}
+
 /* Deselect anything which is selected and refresh the screen if needed. */
 static void
 vte_terminal_deselect_all(VteTerminal *terminal)
@@ -10843,8 +10863,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
 	klass->contents_changed = NULL;
 	klass->cursor_moved = NULL;
 
-	klass->deiconify_window = NULL;
-	klass->iconify_window = NULL;
 	klass->raise_window = NULL;
 	klass->lower_window = NULL;
 	klass->refresh_window = NULL;
@@ -10940,36 +10958,6 @@ vte_terminal_class_init(VteTerminalClass *klass)
 			     G_TYPE_NONE, 0);
 
         /**
-         * VteTerminal::deiconify-window:
-         * @vteterminal: the object which received the signal
-         *
-         * Emitted at the child application's request.
-         */
-                g_signal_new(I_("deiconify-window"),
-			     G_OBJECT_CLASS_TYPE(klass),
-			     G_SIGNAL_RUN_LAST,
-			     G_STRUCT_OFFSET(VteTerminalClass, deiconify_window),
-			     NULL,
-			     NULL,
-                             g_cclosure_marshal_VOID__VOID,
-			     G_TYPE_NONE, 0);
-
-        /**
-         * VteTerminal::iconify-window:
-         * @vteterminal: the object which received the signal
-         *
-         * Emitted at the child application's request.
-         */
-                g_signal_new(I_("iconify-window"),
-			     G_OBJECT_CLASS_TYPE(klass),
-			     G_SIGNAL_RUN_LAST,
-			     G_STRUCT_OFFSET(VteTerminalClass, iconify_window),
-			     NULL,
-			     NULL,
-                             g_cclosure_marshal_VOID__VOID,
-			     G_TYPE_NONE, 0);
-
-        /**
          * VteTerminal::raise-window:
          * @vteterminal: the object which received the signal
          *
@@ -13601,6 +13589,8 @@ vte_buffer_class_init(VteBufferClass *klass)
         klass->window_title_changed = NULL;
         klass->icon_title_changed = NULL;
         klass->status_line_changed = NULL;
+        klass->deiconify_window = NULL;
+        klass->iconify_window = NULL;
 
         /**
          * VteBuffer::child-exited:
@@ -13744,6 +13734,38 @@ vte_buffer_class_init(VteBufferClass *klass)
                              g_cclosure_marshal_VOID__VOID,
                              G_TYPE_NONE, 0);
 
+        /**
+         * VteBuffer::deiconify-window:
+         * @vtebuffer: the object which received the signal
+         *
+         * Emitted at the child application's request.
+         */
+        buffer_signals[BUFFER_DEICONIFY_WINDOW] =
+                g_signal_new(I_("deiconify-window"),
+                             G_OBJECT_CLASS_TYPE(klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET(VteBufferClass, deiconify_window),
+                             NULL,
+                             NULL,
+                             g_cclosure_marshal_VOID__VOID,
+                             G_TYPE_NONE, 0);
+
+        /**
+         * VteBuffer::iconify-window:
+         * @vtebuffer: the object which received the signal
+         *
+         * Emitted at the child application's request.
+         */
+        buffer_signals[BUFFER_ICONIFY_WINDOW] =
+                g_signal_new(I_("iconify-window"),
+                             G_OBJECT_CLASS_TYPE(klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET(VteBufferClass, iconify_window),
+                             NULL,
+                             NULL,
+                             g_cclosure_marshal_VOID__VOID,
+                             G_TYPE_NONE, 0);
+
         /* Properties */
 
         /**
diff --git a/src/vte.h b/src/vte.h
index e098f30..2b8fde3 100644
--- a/src/vte.h
+++ b/src/vte.h
@@ -79,8 +79,6 @@ struct _VteTerminalClass {
 	void (*contents_changed)(VteTerminal* terminal);
 	void (*cursor_moved)(VteTerminal* terminal);
 
-	void (*deiconify_window)(VteTerminal* terminal);
-	void (*iconify_window)(VteTerminal* terminal);
 	void (*raise_window)(VteTerminal* terminal);
 	void (*lower_window)(VteTerminal* terminal);
 	void (*refresh_window)(VteTerminal* terminal);
diff --git a/src/vteapp.c b/src/vteapp.c
index 618f755..b85f9c3 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -214,13 +214,13 @@ button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer data)
 }
 
 static void
-iconify_window(GtkWidget *widget, gpointer data)
+iconify_window(VteBuffer *buffer, gpointer data)
 {
 	gtk_window_iconify(data);
 }
 
 static void
-deiconify_window(GtkWidget *widget, gpointer data)
+deiconify_window(VteBuffer *buffer, gpointer data)
 {
 	gtk_window_deiconify(data);
 }
@@ -980,9 +980,9 @@ main(int argc, char **argv)
 			 G_CALLBACK(button_pressed), widget);
 
 	/* Connect to application request signals. */
-	g_signal_connect(widget, "iconify-window",
+	g_signal_connect(buffer, "iconify-window",
 			 G_CALLBACK(iconify_window), window);
-	g_signal_connect(widget, "deiconify-window",
+	g_signal_connect(buffer, "deiconify-window",
 			 G_CALLBACK(deiconify_window), window);
 	g_signal_connect(widget, "raise-window",
 			 G_CALLBACK(raise_window), window);
diff --git a/src/vtebuffer.h b/src/vtebuffer.h
index b72f7f8..b36606d 100644
--- a/src/vtebuffer.h
+++ b/src/vtebuffer.h
@@ -55,6 +55,8 @@ struct _VteBufferClass {
   void (*eof)                  (VteBuffer* buffer);
   void (*child_exited)         (VteBuffer *buffer,
                                 gint status);
+  void (*deiconify_window)     (VteBuffer* buffer);
+  void (*iconify_window)       (VteBuffer* buffer);
 
   /*< private >*/
   VteBufferClassPrivate *priv;
diff --git a/src/vteseq.c b/src/vteseq.c
index 2b19904..b5b0449 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -179,24 +179,6 @@ vte_parse_color (const char *spec, GdkRGBA *rgba)
         return TRUE;
 }
 
-/* Emit a "deiconify-window" signal. */
-static void
-vte_terminal_emit_deiconify_window(VteTerminal *terminal)
-{
-	_vte_debug_print(VTE_DEBUG_SIGNALS,
-			"Emitting `deiconify-window'.\n");
-	g_signal_emit_by_name(terminal, "deiconify-window");
-}
-
-/* Emit a "iconify-window" signal. */
-static void
-vte_terminal_emit_iconify_window(VteTerminal *terminal)
-{
-	_vte_debug_print(VTE_DEBUG_SIGNALS,
-			"Emitting `iconify-window'.\n");
-	g_signal_emit_by_name(terminal, "iconify-window");
-}
-
 /* Emit a "raise-window" signal. */
 static void
 vte_terminal_emit_raise_window(VteTerminal *terminal)
@@ -3090,12 +3072,12 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
 		case 1:
 			_vte_debug_print(VTE_DEBUG_PARSE,
 					"Deiconifying window.\n");
-			vte_terminal_emit_deiconify_window(terminal);
+			_vte_buffer_emit_deiconify_window(terminal->term_pvt->buffer);
 			break;
 		case 2:
 			_vte_debug_print(VTE_DEBUG_PARSE,
 					"Iconifying window.\n");
-			vte_terminal_emit_iconify_window(terminal);
+			_vte_buffer_emit_iconify_window(terminal->term_pvt->buffer);
 			break;
 		case 3:
 			if ((arg1 != -1) && (arg2 != -2)) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]