Re: [PATCH 3/3] 730243 Port to vte-2.91 API (was Review of patch #730243 - Port to vte-2.91)



Hey Dodji,

On Mon, Jul 07, 2014 at 10:01:12PM +0200, Dodji Seketeli wrote:
diff --git a/configure.ac b/configure.ac
index db99afd..8b1f93f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,7 +353,7 @@ dnl library dependencies for the nemiver common UI module
 DEP_UICOMMON=" gtkmm-3.0 >= $LIBGTKMM_VERSION \
                gtk+-3.0 >= $LIBGTK_VERSION \
                gtksourceviewmm-3.0 >= $LIBGTKSOURCEVIEWMM_VERSION \
-               vte-2.90 >= $LIBVTE_VERSION"
+               vte-2.91 >= $LIBVTE_VERSION"

Yes, we can change LIBVTE_VERSION too. I did not change it because changing
the name of the library from vte-2.90 to vte-2.91 was enough to enforce what
we want. However, it might be more understandable if we bumped LIBVTE_VERSION
too. Whatever you want. :)

 PKG_CHECK_MODULES(NEMIVERUICOMMON, $DEP_UICOMMON $DEP_COMMON $DEP_MEMORYVIEW)
 NEMIVERUICOMMON_CFLAGS="$NEMIVERUICOMMON_CFLAGS $CPPUNIT_CFLAGS"
@@ -376,7 +376,7 @@ AC_SUBST(NEMIVERWORKBENCH_CFLAGS)
 
 dnl library dependencies for the nemiver debug perspective plugin
 DEP_PERSP="gtksourceviewmm-3.0 >= $LIBGTKSOURCEVIEWMM_VERSION \
-           vte-2.90 >= $LIBVTE_VERSION"
+           vte-2.91 >= $LIBVTE_VERSION"
 
 PKG_CHECK_MODULES(NEMIVERDBGPERSP, $DEP_UICOMMON $DEP_VFS $DEP_PERSP $DEP_MEMORYVIEW $DEP_DYNAMICLAYOUT)
 NEMIVERDBGPERSP_LIBS="$NEMIVERDBGPERSP_LIBS $CPPUNIT_LIBS"
diff --git a/src/uicommon/nmv-terminal.cc b/src/uicommon/nmv-terminal.cc
index 717c094..8ba9139 100644
--- a/src/uicommon/nmv-terminal.cc
+++ b/src/uicommon/nmv-terminal.cc
@@ -46,6 +46,7 @@
 #include <gtkmm/menu.h>
 #include <gtkmm/builder.h>
 #include <gtkmm/uimanager.h>
+#include <pangomm/fontdescription.h>
 #include <vte/vte.h>
 #include <glib/gi18n.h>
 #include "common/nmv-exception.h"
@@ -133,12 +134,12 @@ struct Terminal::Priv {
         vte = VTE_TERMINAL (w);
         THROW_IF_FAIL (vte);
 
-        // Mandatory for vte 0.14    
-        vte_terminal_set_font_from_string (vte, "monospace");
+        // Mandatory for vte >= 0.14
+        Pango::FontDescription font_desc ("monospace");
+        vte_terminal_set_font (vte, font_desc.gobj());
 
         vte_terminal_set_scroll_on_output (vte, TRUE);
         vte_terminal_set_scrollback_lines (vte, 1000);
-        vte_terminal_set_emulation (vte, "xterm");
 
         widget = Glib::wrap (w);
         THROW_IF_FAIL (widget);
@@ -264,7 +265,13 @@ struct Terminal::Priv {
         THROW_IF_FAIL (slave_pty);
         THROW_IF_FAIL (master_pty);
 
-        vte_terminal_set_pty (vte, master_pty);
+        GError *err = 0;
+        VtePty *p = vte_pty_new_foreign_sync (master_pty, 0, &err);
+        GErrorSafePtr error (err);
+        SafePtr<VtePty, RefGObjectNative, UnrefGObjectNative> pty (p);

What about using the typedef-ed shorthand instead of the expanded type name?

Happy hacking,
Debarshi

-- 
It has its possibilities but I am bound by my limitations.  -- Vivek Shah

Attachment: pgps7Xm4lReaF.pgp
Description: PGP signature



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