SF.net SVN: geany:[2843] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Jul 30 18:22:52 UTC 2008


Revision: 2843
          http://geany.svn.sourceforge.net/geany/?rev=2843&view=rev
Author:   eht16
Date:     2008-07-30 18:22:51 +0000 (Wed, 30 Jul 2008)

Log Message:
-----------
Make Copy & Paste clipboard keybindings also work for the VTE (closes #2029675).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/callbacks.c
    trunk/src/vte.c
    trunk/src/vte.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-30 18:21:34 UTC (rev 2842)
+++ trunk/ChangeLog	2008-07-30 18:22:51 UTC (rev 2843)
@@ -7,6 +7,9 @@
  * src/vte.c:
    Start the shell in the VTE first when the VTE is actually realized
    to avoid strange display bugs on some systems (closes #1844985).
+ * src/callbacks.c, src/vte.c, src/vte.h:
+   Make Copy & Paste clipboard keybindings also work for the VTE
+   (closes #2029675).
 
 
 2008-07-27  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2008-07-30 18:21:34 UTC (rev 2842)
+++ trunk/src/callbacks.c	2008-07-30 18:22:51 UTC (rev 2843)
@@ -328,7 +328,12 @@
 	else
 	if (IS_SCINTILLA(focusw) && doc != NULL)
 		sci_copy(doc->editor->sci);
+#ifdef HAVE_VTE
 	else
+	if (vte_info.load_vte && vc != NULL && vc->vte == focusw)
+		vte_copy_clipboard();
+#endif
+	else
 	if (GTK_IS_TEXT_VIEW(focusw))
 	{
 		GtkTextBuffer *buffer = gtk_text_view_get_buffer(
@@ -350,25 +355,14 @@
 	else
 	if (IS_SCINTILLA(focusw) && doc != NULL)
 	{
-#if 0
-//#ifdef G_OS_WIN32
-		/* insert the text manually for now, because the auto conversion of EOL characters by
-		 * by Scintilla seems to make problems */
-		/** TODO this is probably obsolete now since we fixed PLAT_GTK_WIN32 in Scintilla */
-		if (gtk_clipboard_wait_is_text_available(gtk_clipboard_get(GDK_NONE)))
-		{
-			gchar *content = gtk_clipboard_wait_for_text(gtk_clipboard_get(GDK_NONE));
-			if (content != NULL)
-			{
-				sci_replace_sel(doc->editor->sci, content);
-				g_free(content);
-			}
-		}
-#else
 		sci_paste(doc->editor->sci);
-#endif
 	}
+#ifdef HAVE_VTE
 	else
+	if (vte_info.load_vte && vc != NULL && vc->vte == focusw)
+		vte_paste_clipboard();
+#endif
+	else
 	if (GTK_IS_TEXT_VIEW(focusw))
 	{
 		GtkTextBuffer *buffer = gtk_text_view_get_buffer(

Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c	2008-07-30 18:21:34 UTC (rev 2842)
+++ trunk/src/vte.c	2008-07-30 18:22:51 UTC (rev 2843)
@@ -203,6 +203,18 @@
 }
 
 
+void vte_copy_clipboard(void)
+{
+	vf->vte_terminal_copy_clipboard(VTE_TERMINAL(vc->vte));
+}
+
+
+void vte_paste_clipboard(void)
+{
+	vf->vte_terminal_paste_clipboard(VTE_TERMINAL(vc->vte));
+}
+
+
 void vte_init(void)
 {
 	if (vte_info.have_vte == FALSE)
@@ -323,7 +335,8 @@
 			 event->keyval == GDK_KP_Enter ||
 			 ((event->keyval == GDK_c) && (event->state & GDK_CONTROL_MASK)))
 	{
-		clean = TRUE; /* assume any text on the prompt has been executed when pressing Enter/Return */
+		/* assume any text on the prompt has been executed when pressing Enter/Return */
+		clean = TRUE;
 	}
 	return FALSE;
 }

Modified: trunk/src/vte.h
===================================================================
--- trunk/src/vte.h	2008-07-30 18:21:34 UTC (rev 2842)
+++ trunk/src/vte.h	2008-07-30 18:22:51 UTC (rev 2843)
@@ -73,6 +73,10 @@
 
 void vte_apply_user_settings(void);
 
+void vte_copy_clipboard(void);
+
+void vte_paste_clipboard(void);
+
 gboolean vte_send_cmd(const gchar *cmd);
 
 const gchar* vte_get_working_directory(void);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list