gnome-terminal r2582 - trunk/src



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

Log:
Use VteTerminal's clipboard operations directly.


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

Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c	(original)
+++ trunk/src/terminal-screen.c	Thu May 29 19:35:41 2008
@@ -1291,17 +1291,6 @@
   /* screen should be finalized here, do not touch it past this point */
 }
 
-gboolean
-terminal_screen_get_text_selected (TerminalScreen *screen)
-{
-  TerminalScreenPrivate *priv = screen->priv;
-  
-  if (GTK_WIDGET_REALIZED (priv->term))
-    return terminal_widget_get_has_selection (priv->term);
-  else
-    return FALSE;
-}
-
 TerminalScreenPopupInfo *
 terminal_screen_popup_info_new (TerminalScreen *screen)
 {

Modified: trunk/src/terminal-screen.h
==============================================================================
--- trunk/src/terminal-screen.h	(original)
+++ trunk/src/terminal-screen.h	Thu May 29 19:35:41 2008
@@ -92,8 +92,6 @@
 
 void terminal_screen_close (TerminalScreen *screen);
 
-gboolean terminal_screen_get_text_selected (TerminalScreen *screen);
-
 void terminal_screen_edit_title (TerminalScreen *screen,
                                  GtkWindow      *transient_parent);
 

Modified: trunk/src/terminal-widget-vte.c
==============================================================================
--- trunk/src/terminal-widget-vte.c	(original)
+++ trunk/src/terminal-widget-vte.c	Thu May 29 19:35:41 2008
@@ -373,20 +373,6 @@
 }
 
 void
-terminal_widget_copy_clipboard (GtkWidget *widget)
-{
-  g_return_if_fail(VTE_IS_TERMINAL(widget));
-  vte_terminal_copy_clipboard(VTE_TERMINAL(widget));
-}
-
-void
-terminal_widget_paste_clipboard (GtkWidget *widget)
-{
-  g_return_if_fail(VTE_IS_TERMINAL(widget));
-  vte_terminal_paste_clipboard(VTE_TERMINAL(widget));
-}
-
-void
 terminal_widget_reset (GtkWidget *widget,
 		       gboolean   also_clear_afterward)
 {
@@ -395,14 +381,6 @@
 }
 
 void
-terminal_widget_disconnect_title_changed (GtkWidget *widget,
-					  GCallback  callback,
-					  void      *data)
-{
-  g_signal_handlers_disconnect_by_func (widget, callback, data);
-}
-
-void
 terminal_widget_connect_child_died (GtkWidget *widget,
 				    GCallback  callback,
 				    void      *data)
@@ -419,14 +397,6 @@
   g_signal_handlers_disconnect_by_func (widget, callback, data);
 }
 
-gboolean
-terminal_widget_get_has_selection (GtkWidget *widget)
-{
-  g_return_val_if_fail(VTE_IS_TERMINAL(widget), FALSE);
-  return vte_terminal_get_has_selection(VTE_TERMINAL(widget));
-}
-
-
 GtkAdjustment*
 terminal_widget_get_scroll_adjustment (GtkWidget *widget)
 {

Modified: trunk/src/terminal-widget.h
==============================================================================
--- trunk/src/terminal-widget.h	(original)
+++ trunk/src/terminal-widget.h	Thu May 29 19:35:41 2008
@@ -106,9 +106,6 @@
 void       terminal_widget_reset                      (GtkWidget            *widget,
                                                        gboolean              also_clear_afterward);
 
-void terminal_widget_disconnect_title_changed      (GtkWidget *widget,
-                                                    GCallback  callback,
-                                                    void      *data);
 void terminal_widget_connect_child_died            (GtkWidget *widget,
                                                     GCallback  callback,
                                                     void      *data);
@@ -116,8 +113,6 @@
                                                     GCallback  callback,
                                                     void      *data);
 
-gboolean    terminal_widget_get_has_selection (GtkWidget *widget);
-
 GtkAdjustment* terminal_widget_get_scroll_adjustment (GtkWidget *widget);
 
 gboolean terminal_widget_fork_command      (GtkWidget   *widget,

Modified: trunk/src/terminal-window.c
==============================================================================
--- trunk/src/terminal-window.c	(original)
+++ trunk/src/terminal-window.c	Thu May 29 19:35:41 2008
@@ -625,7 +625,7 @@
   gboolean can_copy = FALSE;
 
   if (priv->active_term)
-    can_copy = terminal_screen_get_text_selected (priv->active_term);
+    can_copy = vte_terminal_get_has_selection (VTE_TERMINAL (priv->active_term));
 
   action = gtk_action_group_get_action (priv->action_group, "EditCopy");
   gtk_action_set_sensitive (action, can_copy);
@@ -941,7 +941,7 @@
   gtk_action_set_visible (action, priv->terms > 1);
 
   action = gtk_action_group_get_action (priv->action_group, "PopupCopy");
-  gtk_action_set_sensitive (action, terminal_screen_get_text_selected (screen));
+  gtk_action_set_sensitive (action, vte_terminal_get_has_selection (VTE_TERMINAL (screen)));
   action = gtk_action_group_get_action (priv->action_group, "PopupPaste");
   gtk_action_set_sensitive (action, can_paste);
   
@@ -2327,9 +2327,7 @@
   if (!priv->active_term)
     return;
       
-  widget = terminal_screen_get_widget (priv->active_term);
-      
-  terminal_widget_copy_clipboard (widget);
+  vte_terminal_copy_clipboard (VTE_TERMINAL (priv->active_term));
 }
 
 static void
@@ -2342,9 +2340,7 @@
   if (!priv->active_term)
     return;
       
-  widget = terminal_screen_get_widget (priv->active_term);
-
-  terminal_widget_paste_clipboard (widget);
+  vte_terminal_paste_clipboard (VTE_TERMINAL (priv->active_term));
 }
 
 static void



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