[vinagre] Implement 'take screenshot' for SSH connections



commit 593f83363dbbced0ed9d772ece893617bc07fe3f
Author: Jonh Wendell <jwendell gnome org>
Date:   Sat Jun 26 12:46:15 2010 -0300

    Implement 'take screenshot' for SSH connections

 configure.ac                  |   22 ++++++++++++++++++++++
 plugins/Makefile.am           |    7 ++++++-
 plugins/ssh/vinagre-ssh-tab.c |   12 +++++++++++-
 3 files changed, 39 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6f68cd4..825cac6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,26 @@ if test "x$enable_ssh" = "xyes" ; then
 fi
 AM_CONDITIONAL(SSH, test "x$enable_ssh" = "xyes")
 
+dnl ****************************
+dnl *** Checks for RDP stuff ***
+dnl ****************************
+
+AC_ARG_ENABLE(rdp,
+              AS_HELP_STRING([--enable-rdp],
+                             [Enable RDP plugin (default=yes)]),
+              enable_rdp=${enableval},
+              enable_rdp=yes)
+
+if test "x$enable_rdp" = "xyes" ; then
+  AC_PATH_PROG(RDESKTOP_PROGRAM, rdesktop, "rdesktop")
+  PKG_CHECK_MODULES(RDP,\
+  libxml-2.0 >= $XML_REQUIRED)
+  AC_SUBST(RDP_CFLAGS)
+  AC_SUBST(RDP_LIBS)
+  AC_DEFINE([VINAGRE_ENABLE_RDP],[1],[We want rdp support])
+fi
+AM_CONDITIONAL(RDP, test "x$enable_rdp" = "xyes")
+
 # Check for telepathy
 AC_ARG_ENABLE(telepathy,
               AS_HELP_STRING([--enable-telepathy=@<:@no/yes/auto@:>@],
@@ -283,6 +303,7 @@ plugin-loaders/c/Makefile
 plugins/Makefile
 plugins/vnc/Makefile
 plugins/ssh/Makefile
+plugins/rdp/Makefile
 vinagre/Makefile
 vinagre/view/Makefile
 ])
@@ -303,4 +324,5 @@ Configure summary:
 	GNOME Panel applet..........:  ${enable_applet}
 	Telepathy support ..........:  ${have_telepathy}
 	SSH plugin .................:  ${enable_ssh}
+	RDP plugin .................:  ${enable_rdp}
 "
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 5d78bb9..0018cee 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,6 +1,7 @@
 DIST_SUBDIRS =	\
   vnc		\
-  ssh
+  ssh		\
+  rdp
 
 SUBDIRS = 		\
   vnc
@@ -9,4 +10,8 @@ if SSH
 SUBDIRS += ssh
 endif
 
+if RDP
+SUBDIRS += rdp
+endif
+
 -include $(top_srcdir)/git.mk
diff --git a/plugins/ssh/vinagre-ssh-tab.c b/plugins/ssh/vinagre-ssh-tab.c
index 63bd901..e851c27 100644
--- a/plugins/ssh/vinagre-ssh-tab.c
+++ b/plugins/ssh/vinagre-ssh-tab.c
@@ -53,7 +53,17 @@ ssh_tab_get_tooltip (VinagreTab *tab)
 static GdkPixbuf *
 ssh_tab_get_screenshot (VinagreTab *tab)
 {
-  return NULL;
+  GdkPixbuf *pixbuf;
+  GdkPixmap *pixmap = gtk_widget_get_snapshot (VINAGRE_SSH_TAB (tab)->priv->vte, NULL);
+
+  pixbuf = gdk_pixbuf_get_from_drawable (NULL,
+					 GDK_DRAWABLE (pixmap),
+					 gdk_colormap_get_system (),
+					 0, 0, 0, 0,
+					 -1, -1);
+
+  g_object_unref (pixmap);
+  return pixbuf;
 }
 
 static gboolean



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