nemiver r717 - in trunk: . src/persp/dbgperspective src/workbench



Author: jjongsma
Date: Fri Feb  1 03:06:47 2008
New Revision: 717
URL: http://svn.gnome.org/viewvc/nemiver?rev=717&view=rev

Log:
	Add ability to build with giomm instead of gnome-vfs
	* configure.ac: add --enable-gio argument, which will build with gio as the
	vfs library instead of using gnome-vfs
	* config.h.in: add WITH_GIO preprocessor symbol
	* src/persp/dbgperspective/nmv-dbg-perspective.cc:
	* src/workbench/nmv-workbench.cc: #ifdef out gnome-vfs-specific
	functionality.  No replacement gio functionality is actually implemented
	yet, only the infrastructure is set up


Modified:
   trunk/ChangeLog
   trunk/config.h.in
   trunk/configure.ac
   trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc
   trunk/src/workbench/nmv-workbench.cc

Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in	(original)
+++ trunk/config.h.in	Fri Feb  1 03:06:47 2008
@@ -93,6 +93,9 @@
 /* Version number of package */
 #undef VERSION
 
+/* build with gio instead of gnomevfs */
+#undef WITH_GIO
+
 /* compile the the memory view widget */
 #undef WITH_MEMORYVIEW
 

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Feb  1 03:06:47 2008
@@ -38,6 +38,7 @@
 LIBGLADEMM_VERSION=2.6.0
 LIBGTKSOURCEVIEWMM1_VERSION=0.3.0
 LIBGTKSOURCEVIEWMM2_VERSION=1.9.4
+LIBGIOMM_VERSION=2.15.2
 SQLITE3_VERSION=3.0
 LIBGTOP_VERSION=2.14
 LIBVTE_VERSION=0.12.0
@@ -150,7 +151,7 @@
 
 AC_ARG_ENABLE(sourceviewmm2,
               AC_HELP_STRING([--enable-sourceviewmm2=yes|no],
-                            [enable the memory view hex editor (default is no)]),
+                            [enable the memory view hex editor (default is auto)]),
               ENABLE_SOURCEVIEWMM2=$enableval,
               [PKG_CHECK_EXISTS([gtksourceviewmm-2.0 >= $LIBGTKSOURCEVIEWMM2_VERSION], [ENABLE_SOURCEVIEWMM2=yes], [ENABLE_SOURCEVIEWMM2=no])])
 if test x$ENABLE_SOURCEVIEWMM2 = xyes ; then
@@ -163,6 +164,21 @@
     LIBGTKSOURCEVIEWMM_PKG=libgtksourceviewmm-1.0
 fi
 
+AC_ARG_ENABLE(gio,
+              AC_HELP_STRING([--enable-gio=yes|no],
+                            [use gio instead of gnomevfs (default is auto)]),
+              ENABLE_GIO=$enableval,
+              [PKG_CHECK_EXISTS([giomm-2.4 >= $LIBGIOMM_VERSION], [ENABLE_GIO=yes], [ENABLE_GIO=no])])
+if test x$ENABLE_GIO = xyes ; then
+    AC_DEFINE([WITH_GIO], 1, [build with gio instead of gnomevfs])
+    VFS_PKG=giomm-2.4
+    VFS_VERSION=$LIBGIOMM_VERSION
+else
+    VFS_PKG=gnome-vfs-2.0
+    VFS_VERSION=$LIBGNOMEVFS_VERSION
+    ENABLE_GIO=no
+fi
+
 
 ENABLE_DEBUG=yes
 AC_ARG_ENABLE(debug,
@@ -211,7 +227,7 @@
 PKG_CHECK_MODULES(LIBGMODULE, [gmodule-2.0 >= $LIBGMODULE_VERSION])
 PKG_CHECK_MODULES(LIBGTHREAD, [gthread-2.0 >= $LIBGTHREAD_VERSION])
 PKG_CHECK_MODULES(LIBGNOME, [libgnome-2.0 >= $LIBGNOME_VERSION])
-PKG_CHECK_MODULES(LIBGNOMEVFS, [gnome-vfs-2.0 >= $LIBGNOMEVFS_VERSION])
+PKG_CHECK_MODULES(LIBVFS, [$VFS_PKG >= $VFS_VERSION])
 PKG_CHECK_MODULES(LIBGTOP, [libgtop-2.0 >= $LIBGTOP_VERSION])
 PKG_CHECK_MODULES(GCONF,[gconf-2.0 >= $GCONF_VERSION])
 PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4 >= $LIBGLIBMM_VERSION])
@@ -276,11 +292,11 @@
 dnl library dependencies for the nemiver workbench module
 NEMIVERWORKBENCH_LIBS="$NEMIVERCOMMON_LIBS $LIBGTKMM_LIBS $LIBGLADEMM_LIBS"
 NEMIVERWORKBENCH_LIBS="$NEMIVERWORKBENCH_LIBS $LIBGNOME_LIBS"
-NEMIVERWORKBENCH_LIBS="$NEMIVERWORKBENCH_LIBS $LIBGNOMEVFS_LIBS"
+NEMIVERWORKBENCH_LIBS="$NEMIVERWORKBENCH_LIBS $LIBVFS_LIBS"
 NEMIVERWORKBENCH_CFLAGS="$NEMIVERCOMMON_CFLAGS $LIBGTKMM_CFLAGS "
 NEMIVERWORKBENCH_CFLAGS="$NEMIVERWORKBENCH_CFLAGS $LIBGLADEMM_CFLAGS"
 NEMIVERWORKBENCH_CFLAGS="$NEMIVERWORKBENCH_CFLAGS $LIBGNOME_CFLAGS"
-NEMIVERWORKBENCH_CFLAGS="$NEMIVERWORKBENCH_CFLAGS $LIBGNOMEVFS_CFLAGS"
+NEMIVERWORKBENCH_CFLAGS="$NEMIVERWORKBENCH_CFLAGS $LIBVFS_CFLAGS"
 
 AC_SUBST(NEMIVERWORKBENCH_LIBS)
 AC_SUBST(NEMIVERWORKBENCH_CFLAGS)
@@ -288,12 +304,12 @@
 dnl library dependencies for the nemiver debug perspective plugin
 NEMIVERDBGPERSP_LIBS="$NEMIVERUICOMMON_LIBS $LIBGLADEMM_LIBS"
 NEMIVERDBGPERSP_LIBS="$NEMIVERDBGPERSP_LIBS $LIBVTE_LIBS"
-NEMIVERDBGPERSP_LIBS="$NEMIVERDBGPERSP_LIBS $LIBGNOMEVFS_LIBS"
+NEMIVERDBGPERSP_LIBS="$NEMIVERDBGPERSP_LIBS $LIBVFS_LIBS"
 
 NEMIVERDBGPERSP_CFLAGS="$NEMIVERUICOMMON_CFLAGS $LIBGTKSOURCEVIEWMM_CFLAGS"
 NEMIVERDBGPERSP_CFLAGS="$NEMIVERDBGPERSP_CFLAGS $LIBVTE_CFLAGS "
 NEMIVERDBGPERSP_CFLAGS="$NEMIVERDBGPERSP_CFLAGS $LIBGLADEMM_CFLAGS"
-NEMIVERDBGPERSP_CFLAGS="$NEMIVERDBGPERSP_CFLAGS $LIBGNOMEVFS_CFLAGS"
+NEMIVERDBGPERSP_CFLAGS="$NEMIVERDBGPERSP_CFLAGS $LIBVFS_CFLAGS"
 
 AC_SUBST(NEMIVERDBGPERSP_LIBS)
 AC_SUBST(NEMIVERDBGPERSP_CFLAGS)
@@ -439,6 +455,7 @@
     Enable workbench                : ${ENABLE_WORKBENCH}
     Enable memory view              : ${ENABLE_MEMORYVIEW} (requires gtkhex > $GTKHEX_VERSION)
     gtksourceviewmm version         : ${LIBGTKSOURCEVIEWMM_PKG}
+    VFS library                     : ${VFS_PKG}
     Enable variable walker          : ${ENABLE_VARIABLE_WALKER}
     Enable symbols visibility ctrl  : ${ENABLE_GCC_SYMBOLS_VISIBILITY}
     Maintainer mode                 : ${USER_MAINTAINER_MODE}

Modified: trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc
==============================================================================
--- trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc	(original)
+++ trunk/src/persp/dbgperspective/nmv-dbg-perspective.cc	Fri Feb  1 03:06:47 2008
@@ -29,16 +29,22 @@
 #include <iostream>
 #include <fstream>
 #include <glib/gi18n.h>
+
+#ifdef WITH_GIO
+#else
 #include <libgnomevfs/gnome-vfs-mime-utils.h>
 #include <libgnomevfs/gnome-vfs-monitor.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
+#endif // WITH_GIO
+
 #include <gtksourceviewmm/init.h>
 #ifdef WITH_SOURCEVIEWMM2
 #include <gtksourceviewmm/sourcelanguagemanager.h>
 #else
 #include <gtksourceviewmm/sourcelanguagesmanager.h>
 #endif  // WITH_SOURCEVIEWMM2
+
 #include <pangomm/fontdescription.h>
 #include <gtkmm/clipboard.h>
 #include <gtkmm/separatortoolitem.h>
@@ -59,11 +65,13 @@
 #include "nmv-ui-utils.h"
 #include "nmv-call-stack.h"
 #include "nmv-spinner-tool-item.h"
+
 #ifndef WITH_VARIABLE_WALKER
 #include "nmv-local-vars-inspector.h"
 #else
 #include "nmv-local-vars-inspector2.h"
 #endif
+
 #include "nmv-global-vars-inspector-dialog.h"
 #include "nmv-terminal.h"
 #include "nmv-breakpoints-view.h"
@@ -623,12 +631,15 @@
     }
 };
 
+#ifdef WITH_GIO
+#else
 static
-void file_monitor_cb (GnomeVFSMonitorHandle *a_handle,
+void gnome_vfs_file_monitor_cb (GnomeVFSMonitorHandle *a_handle,
                       const gchar *a_monitor_uri,
                       const gchar *a_info_uri,
                       GnomeVFSMonitorEventType a_event_type,
                       DBGPerspective *a_persp) ;
+#endif // WITH_GIO
 
 struct DBGPerspective::Priv {
     bool initialized ;
@@ -692,8 +703,11 @@
     map<UString, int> basename_2_pagenum_map ;
     map<int, SourceEditor*> pagenum_2_source_editor_map ;
     map<int, UString> pagenum_2_path_map ;
+#ifdef WITH_GIO
+#else
     typedef map<UString, GnomeVFSMonitorHandle*> Path2MHandleMap ;
     Path2MHandleMap path_2_mhandle_map;
+#endif // WITH_GIO
     Gtk::Notebook *statuses_notebook ;
 #ifndef WITH_VARIABLE_WALKER
     SafePtr<LocalVarsInspector> variables_editor ;
@@ -929,8 +943,10 @@
     return false ;
 }
 
+#ifdef WITH_GIO
+#else
 static void
-file_monitor_cb (GnomeVFSMonitorHandle *a_handle,
+gnome_vfs_file_monitor_cb (GnomeVFSMonitorHandle *a_handle,
                  const gchar *a_monitor_uri,
                  const gchar *a_info_uri,
                  GnomeVFSMonitorEventType a_event_type,
@@ -961,6 +977,7 @@
     }
     NEMIVER_CATCH
 }
+#endif // WITH_GIO
 
 ostream&
 operator<< (ostream &a_out,
@@ -3496,6 +3513,8 @@
 {
     THROW_IF_FAIL (m_priv) ;
 
+#ifdef WITH_GIO
+#else
     if (m_priv->path_2_mhandle_map.find (a_path) !=
         m_priv->path_2_mhandle_map.end ()) {
         return false ;
@@ -3505,7 +3524,7 @@
     GnomeVFSResult result = gnome_vfs_monitor_add
                                     (&handle, uri.get (),
                                      GNOME_VFS_MONITOR_FILE,
-                                     (GnomeVFSMonitorCallback)file_monitor_cb,
+                                     (GnomeVFSMonitorCallback)gnome_vfs_file_monitor_cb,
                                      (gpointer)this) ;
     if (result != GNOME_VFS_OK) {
         LOG_ERROR ("failed to start monitoring file '" << a_path << "'") ;
@@ -3517,6 +3536,7 @@
     }
     THROW_IF_FAIL (handle) ;
     m_priv->path_2_mhandle_map[a_path] = handle ;
+#endif // WITH_GIO
     LOG_DD ("Monitoring file '" << Glib::filename_from_utf8 (a_path)) ;
     return true ;
 }
@@ -3526,6 +3546,9 @@
 {
     THROW_IF_FAIL (m_priv) ;
 
+#ifdef WITH_GIO
+    if (a_path.empty ()) {}
+#else
     map<UString, GnomeVFSMonitorHandle*>::iterator it =
                                     m_priv->path_2_mhandle_map.find (a_path);
     if (it == m_priv->path_2_mhandle_map.end ()) {
@@ -3535,8 +3558,10 @@
         gnome_vfs_monitor_cancel (it->second) ;
     }
     m_priv->path_2_mhandle_map.erase (it) ;
+#endif // WITH_GIO
     return true ;
 }
+
 void
 DBGPerspective::read_default_config ()
 {
@@ -3879,7 +3904,11 @@
     UString base_name = Glib::filename_to_utf8
         (Glib::path_get_basename (Glib::filename_from_utf8 (a_path))) ;
 
-    UString mime_type = gnome_vfs_get_mime_type_for_name (base_name.c_str ()) ;
+    UString mime_type;
+#ifdef WITH_GIO
+#else
+    mime_type = gnome_vfs_get_mime_type_for_name (base_name.c_str ()) ;
+#endif // WITH_GIO
     if (mime_type == "") {
         mime_type = "text/x-c++" ;
     }

Modified: trunk/src/workbench/nmv-workbench.cc
==============================================================================
--- trunk/src/workbench/nmv-workbench.cc	(original)
+++ trunk/src/workbench/nmv-workbench.cc	Fri Feb  1 03:06:47 2008
@@ -23,11 +23,16 @@
  *See COPYRIGHT file copyright information.
  */
 
+#include "config.h"
 #include <vector>
 #include <iostream>
 #include <glib/gi18n.h>
 #include <libgnome/gnome-help.h>
+#ifdef WITH_GIO
+#include <giomm/init.h>
+#else
 #include <libgnomevfs/gnome-vfs-init.h>
+#endif // WITH_GIO
 #include <gtkmm/aboutdialog.h>
 #include <gtkmm/icontheme.h>
 #include "common/nmv-exception.h"
@@ -63,12 +68,18 @@
 class WorkbenchStaticInit {
     WorkbenchStaticInit ()
     {
+#ifdef WITH_GIO
+        Gio::init();
+#else
         gnome_vfs_init () ;
+#endif // WITH_GIO
     }
 
     ~WorkbenchStaticInit ()
     {
+#ifndef WITH_GIO
         gnome_vfs_shutdown () ;
+#endif  // WITH_GIO
     }
 
 public:



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