gnome-terminal r2770 - trunk/src



Author: chpe
Date: Thu May 29 19:52:36 2008
New Revision: 2770
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2770&view=rev

Log:
Remove terminal_screen_get_window.


Modified:
   trunk/src/terminal-app.c
   trunk/src/terminal-screen.c
   trunk/src/terminal-screen.h
   trunk/src/terminal-window.c

Modified: trunk/src/terminal-app.c
==============================================================================
--- trunk/src/terminal-app.c	(original)
+++ trunk/src/terminal-app.c	Thu May 29 19:52:36 2008
@@ -1786,11 +1786,14 @@
     }
   else
     {
-      TerminalWindow *source_window;
+      GtkWidget *source_toplevel;
 
-      source_window = terminal_screen_get_window (screen);
-      if (source_window)
+      source_toplevel = gtk_widget_get_toplevel (GTK_WIDGET (screen));
+      if (GTK_WIDGET_TOPLEVEL (source_toplevel) &&
+          TERMINAL_IS_WINDOW (source_toplevel))
         {
+          TerminalWindow *source_window = TERMINAL_WINDOW (source_toplevel);
+
           g_object_ref_sink (screen);
           terminal_window_remove_screen (source_window, screen);
           terminal_window_add_screen (window, screen, -1);

Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c	(original)
+++ trunk/src/terminal-screen.c	Thu May 29 19:52:36 2008
@@ -555,12 +555,6 @@
   return g_object_new (TERMINAL_TYPE_SCREEN, NULL);
 }
 
-TerminalWindow*
-terminal_screen_get_window (TerminalScreen *screen)
-{
-  return screen->priv->window;
-}
-
 void
 terminal_screen_set_window (TerminalScreen *screen,
                             TerminalWindow *window)
@@ -611,7 +605,6 @@
 {
   TerminalScreenPrivate *priv = screen->priv;
   VteTerminal *vte_terminal = VTE_TERMINAL (screen);
-  TerminalWindow *window;
   const char *prop_name;
   TerminalBackgroundType bg_type;
 
@@ -725,11 +718,10 @@
           vte_terminal_set_opacity (vte_terminal, 0xffff);
         }
       
-      window = terminal_screen_get_window (screen);
       /* FIXME: Don't enable this if we have a compmgr. */
       vte_terminal_set_background_transparent (vte_terminal,
                                               bg_type == TERMINAL_BACKGROUND_TRANSPARENT &&
-                                              (!window || !terminal_window_uses_argb_visual (window)));
+                                              (!priv->window || !terminal_window_uses_argb_visual (priv->window)));
     }
 
   if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKSPACE_BINDING))
@@ -1462,7 +1454,7 @@
                                                      NULL);
       if (skey_match != NULL)
 	{
-	  terminal_skey_do_popup (screen, GTK_WINDOW (terminal_screen_get_window (screen)), skey_match);
+	  terminal_skey_do_popup (screen, GTK_WINDOW (priv->window), skey_match);
 	  g_free (skey_match);
           g_free (matched_string);
 
@@ -2065,9 +2057,9 @@
 
         g_return_if_fail (TERMINAL_IS_SCREEN (moving_screen));
 
-        source_window = terminal_screen_get_window (moving_screen);
+        source_window = moving_screen->priv->window;
         source_notebook = terminal_window_get_notebook (source_window);
-        dest_window = terminal_screen_get_window (screen);
+        dest_window = screen->priv->window;
         dest_notebook = terminal_window_get_notebook (dest_window);
         page_num = gtk_notebook_page_num (GTK_NOTEBOOK (dest_notebook), 
                                           GTK_WIDGET (screen));

Modified: trunk/src/terminal-screen.h
==============================================================================
--- trunk/src/terminal-screen.h	(original)
+++ trunk/src/terminal-screen.h	Thu May 29 19:52:36 2008
@@ -69,8 +69,6 @@
 
 TerminalScreen* terminal_screen_new                    (void);
 
-
-TerminalWindow* terminal_screen_get_window (TerminalScreen *screen);
 /* Used in terminal-window.c only, others should call terminal_window_add_screen() */
 void terminal_screen_set_window (TerminalScreen *screen,
                                  TerminalWindow *window);

Modified: trunk/src/terminal-window.c
==============================================================================
--- trunk/src/terminal-window.c	(original)
+++ trunk/src/terminal-window.c	Thu May 29 19:52:36 2008
@@ -1757,16 +1757,17 @@
                             gint            position)
 {
   TerminalWindowPrivate *priv = window->priv;
-  TerminalWindow *old;
+  GtkWidget *old_window;
   GtkWidget *screen_container, *tab_label;
  
-  old = terminal_screen_get_window (screen);
-
-  if (old == window)
+  old_window = gtk_widget_get_toplevel (GTK_WIDGET (screen));
+  if (GTK_WIDGET_TOPLEVEL (old_window) &&
+      TERMINAL_IS_WINDOW (old_window) &&
+      TERMINAL_WINDOW (old_window)== window)
     return;  
 
-  if (old)
-    terminal_window_remove_screen (old, screen);
+  if (TERMINAL_IS_WINDOW (old_window))
+    terminal_window_remove_screen (TERMINAL_WINDOW (old_window), screen);
 
   screen_container = terminal_screen_container_new (screen);
   gtk_widget_show (screen_container);
@@ -1801,7 +1802,7 @@
   GtkWidget *scrolled_window;
   guint num_page;
 
-  g_return_if_fail (terminal_screen_get_window (screen) == window);
+  g_return_if_fail (gtk_widget_get_toplevel (GTK_WIDGET (screen)) == GTK_WIDGET (window));
 
   update_tab_visibility (window, -1);
 



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