[gnome-terminal] Update to new switch-page signal signature



commit 35d52531fc9dbd2eeb56f8bf5a2159eb03f0e676
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun Jul 18 21:08:46 2010 +0200

    Update to new switch-page signal signature
    
    GtkNotebookPage has been removed and and the switch-page signal now gets
    an opaque gpointer as second parameter in GTK+ 2.22, and a GtkWidget*
    pointing to the page in GTK+ 3.0.
    
    Bug #624603.

 src/terminal-tabs-menu.c |   10 +++++++++-
 src/terminal-window.c    |   20 +++++++++++++++++---
 2 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/src/terminal-tabs-menu.c b/src/terminal-tabs-menu.c
index ef7cf07..1fccbdb 100644
--- a/src/terminal-tabs-menu.c
+++ b/src/terminal-tabs-menu.c
@@ -265,7 +265,11 @@ notebook_page_reordered_cb (GtkNotebook *notebook,
 
 static void
 notebook_page_switch_cb (GtkNotebook *notebook,
-                         GtkNotebookPage *page,
+#if GTK_CHECK_VERSION (2, 90, 6)
+                         GtkWidget *page,
+#else
+                         gpointer page,
+#endif
                          guint position,
                          TerminalTabsMenu *menu)
 {
@@ -273,7 +277,11 @@ notebook_page_switch_cb (GtkNotebook *notebook,
         TerminalScreen *screen;
         GtkAction *action;
 
+#if GTK_CHECK_VERSION (2, 90, 6)
+        container = TERMINAL_SCREEN_CONTAINER (page);
+#else
         container = TERMINAL_SCREEN_CONTAINER (gtk_notebook_get_nth_page (notebook, position));
+#endif
         screen = terminal_screen_container_get_screen (container);
 
 	action = g_object_get_data (G_OBJECT (screen), DATA_KEY);
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 8114569..aa34447 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -119,7 +119,11 @@ static gboolean notebook_button_press_cb     (GtkWidget *notebook,
 static gboolean notebook_popup_menu_cb       (GtkWidget *notebook,
                                               TerminalWindow *window);
 static void notebook_page_selected_callback  (GtkWidget       *notebook,
-                                              GtkNotebookPage *page,
+#if GTK_CHECK_VERSION (2, 90, 6)
+                                              GtkWidget       *page,
+#else
+                                              gpointer         page,
+#endif
                                               guint            page_num,
                                               TerminalWindow  *window);
 static void notebook_page_added_callback     (GtkWidget       *notebook,
@@ -2659,15 +2663,22 @@ notebook_popup_menu_cb (GtkWidget *widget,
 
 static void
 notebook_page_selected_callback (GtkWidget       *notebook,
-                                 GtkNotebookPage *useless_crap,
+#if GTK_CHECK_VERSION (2, 90, 6)
+                                 GtkWidget       *page_widget,
+#else
+                                 gpointer         useless_crap,
+#endif
                                  guint            page_num,
                                  TerminalWindow  *window)
 {
   TerminalWindowPrivate *priv = window->priv;
-  GtkWidget* page_widget, *widget;
+  GtkWidget *widget;
   TerminalScreen *screen;
   TerminalProfile *profile;
   int old_grid_width, old_grid_height;
+#if !GTK_CHECK_VERSION (2, 90, 6)
+  GtkWidget *page_widget;
+#endif
 
   _terminal_debug_print (TERMINAL_DEBUG_MDI,
                          "[window %p] MDI: page-selected %d\n",
@@ -2676,7 +2687,10 @@ notebook_page_selected_callback (GtkWidget       *notebook,
   if (priv->disposed)
     return;
 
+#if !GTK_CHECK_VERSION (2, 90, 6)
   page_widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
+#endif
+
   screen = terminal_screen_container_get_screen (TERMINAL_SCREEN_CONTAINER (page_widget));
   widget = GTK_WIDGET (screen);
   g_assert (screen != NULL);



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