Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-menus/configure.in,v
retrieving revision 1.75
diff -u -r1.75 configure.in
--- configure.in	22 Aug 2005 08:59:55 -0000	1.75
+++ configure.in	31 Aug 2005 16:40:20 -0000
@@ -37,25 +37,11 @@
 dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
 AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
 
-PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6.0)
-AC_SUBST(GLIB_CFLAGS)
-AC_SUBST(GLIB_LIBS)
-
-dnl check for FAM
-FAM_LIBS=
-AC_CHECK_LIB(fam, FAMOpen,
-  [AC_CHECK_HEADERS(fam.h,
-    [AC_DEFINE(HAVE_FAM, [], [Define if we have FAM])
-     FAM_LIBS="-lfam"],
-    AC_MSG_WARN(*** FAM support will not be built (header files not found) ***))],
-  AC_MSG_WARN(*** FAM support will not be built (FAM library not found) ***))
-AC_SUBST(FAM_LIBS)
-
-dnl check for gamin extension
-gmenu_save_libs="$LIBS"
-LIBS="$LIBS $FAM_LIBS"
-AC_CHECK_FUNCS(FAMNoExists)
-LIBS="$gmenu_save_libs"
+PKG_CHECK_MODULES(LIBMENU,
+                  glib-2.0 >= 2.5.6 \
+		  gnome-vfs-2.0 >= 2.8.2)
+AC_SUBST(LIBMENU_CFLAGS)
+AC_SUBST(LIBMENU_LIBS)
 
 GNOME_COMPILE_WARNINGS(yes)
 
@@ -64,11 +50,15 @@
                               [warn about deprecated usages [default=no]])],,
               [enable_deprecations=no])
 
-DISABLE_DEPRECATED_CFLAGS=
 if test "x$enable_deprecations" = "xyes"; then
-   DISABLE_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED"
+   DISABLE_DEPRECATED_CFLAGS="\
+-DG_DISABLE_DEPRECATED \
+-DGDK_DISABLE_DEPRECATED \
+-DGTK_DISABLE_DEPRECATED \
+-DGDK_PIXBUF_DISABLE_DEPRECATED \
+-DGNOME_DISABLE_DEPRECATED"
+   AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
 fi
-AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
 
 dnl --enable-debug=(yes|minimum|no)
 AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=yes)
Index: libmenu/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/Makefile.am,v
retrieving revision 1.5
diff -u -r1.5 Makefile.am
--- libmenu/Makefile.am	8 Jun 2005 15:25:20 -0000	1.5
+++ libmenu/Makefile.am	31 Aug 2005 16:40:21 -0000
@@ -2,7 +2,7 @@
 
 INCLUDES =				\
 	-DGMENU_I_KNOW_THIS_IS_UNSTABLE	\
-	$(GLIB_CFLAGS)			\
+	$(LIBMENU_CFLAGS)		\
 	$(DISABLE_DEPRECATED_CFLAGS)	\
 	$(DEBUG_CFLAGS)			\
 	$(WARN_CFLAGS)			\
@@ -21,15 +21,12 @@
 	gmenu-tree.h			\
 	menu-layout.c			\
 	menu-layout.h			\
-	menu-monitor.c			\
-	menu-monitor.h			\
 	menu-util.c			\
 	menu-util.h			\
 	$(NULL)
 
 libgnome_menu_la_LIBADD = 		\
-	$(GLIB_LIBS)			\
-	$(FAM_LIBS)			\
+	$(LIBMENU_LIBS)			\
 	$(NULL)
 libgnome_menu_la_LDFLAGS =			\
 	-version-info $(LIB_MENU_LT_VERSION)	\
@@ -50,3 +47,6 @@
 
 pkgconfigdir   = $(libdir)/pkgconfig
 pkgconfig_DATA = libgnome-menu.pc
+
+
+
Index: libmenu/entry-directories.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/entry-directories.c,v
retrieving revision 1.17
diff -u -r1.17 entry-directories.c
--- libmenu/entry-directories.c	22 Aug 2005 08:19:34 -0000	1.17
+++ libmenu/entry-directories.c	31 Aug 2005 16:40:21 -0000
@@ -25,9 +25,9 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <dirent.h>
+#include <libgnomevfs/gnome-vfs.h>
 
 #include "menu-util.h"
-#include "menu-monitor.h"
 #include "canonicalize.h"
 
 typedef struct CachedDir CachedDir;
@@ -58,13 +58,15 @@
   GSList *entries;
   GSList *subdirs;
 
-  MenuMonitor *dir_monitor;
-  GSList      *monitors;
+  GnomeVFSMonitorHandle *monitor;
+  GSList                *monitors;
 
   guint have_read_entries : 1;
   guint deleted : 1;
 
   guint references : 28;
+
+  gboolean no_monitor_support;
 };
 
 struct CachedDirMonitor
@@ -78,11 +80,6 @@
 static gboolean cached_dir_load_entries_recursive (CachedDir  *dir,
                                                    const char *dirname);
 
-static void handle_cached_dir_changed (MenuMonitor      *monitor,
-				       MenuMonitorEvent  event,
-				       const char       *path,
-				       CachedDir        *dir);
-
 /*
  * Entry directory cache
  */
@@ -104,14 +101,9 @@
 static void
 cached_dir_free (CachedDir *dir)
 {
-  if (dir->dir_monitor)
-    {
-      menu_monitor_remove_notify (dir->dir_monitor,
-				  (MenuMonitorNotifyFunc) handle_cached_dir_changed,
-				  dir);
-      menu_monitor_unref (dir->dir_monitor);
-      dir->dir_monitor = NULL;
-    }
+  if (dir->monitor)
+	  gnome_vfs_monitor_cancel (dir->monitor);
+  dir->monitor = NULL;
 
   g_slist_foreach (dir->monitors, (GFunc) g_free, NULL);
   g_slist_free (dir->monitors);
@@ -399,20 +391,31 @@
 }
 
 static void
-handle_cached_dir_changed (MenuMonitor      *monitor,
-			   MenuMonitorEvent  event,
-			   const char       *path,
-                           CachedDir        *dir)
+handle_cached_dir_changed (GnomeVFSMonitorHandle    *handle,
+			   const char               *monitor_uri,
+			   const char               *info_uri,
+			   GnomeVFSMonitorEventType  event,
+			   CachedDir                *dir)
 {
   gboolean  handled = FALSE;
+  char     *path;
   char     *basename;
   char     *dirname;
 
+  if (event != GNOME_VFS_MONITOR_EVENT_CREATED &&
+      event != GNOME_VFS_MONITOR_EVENT_DELETED &&
+      event != GNOME_VFS_MONITOR_EVENT_CHANGED)
+    return;
+
+  if (!(path = gnome_vfs_get_local_path_from_uri (info_uri)))
+    return;
+
   menu_verbose ("'%s' notified of '%s' %s - invalidating cache\n",
 		dir->name,
                 path,
-                event == MENU_MONITOR_EVENT_CREATED ? ("created") :
-                event == MENU_MONITOR_EVENT_DELETED ? ("deleted") : ("changed"));
+                event == GNOME_VFS_MONITOR_EVENT_CREATED ? ("created") :
+                event == GNOME_VFS_MONITOR_EVENT_DELETED ? ("deleted") : 
+                event == GNOME_VFS_MONITOR_EVENT_CHANGED ? ("changed") : ("unknown-event"));
 
   dirname  = g_path_get_dirname  (path);
   basename = g_path_get_basename (path);
@@ -424,12 +427,12 @@
     {
       switch (event)
         {
-        case MENU_MONITOR_EVENT_CREATED:
-        case MENU_MONITOR_EVENT_CHANGED:
+        case GNOME_VFS_MONITOR_EVENT_CREATED:
+        case GNOME_VFS_MONITOR_EVENT_CHANGED:
           handled = cached_dir_update_entry (dir, basename, path);
           break;
 
-        case MENU_MONITOR_EVENT_DELETED:
+        case GNOME_VFS_MONITOR_EVENT_DELETED:
           handled = cached_dir_remove_entry (dir, basename);
           break;
 
@@ -442,14 +445,14 @@
     {
       switch (event)
         {
-        case MENU_MONITOR_EVENT_CREATED:
+        case GNOME_VFS_MONITOR_EVENT_CREATED:
           handled = cached_dir_add_subdir (dir, basename, path);
           break;
 
-        case MENU_MONITOR_EVENT_CHANGED:
+        case GNOME_VFS_MONITOR_EVENT_CHANGED:
           break;
 
-        case MENU_MONITOR_EVENT_DELETED:
+        case GNOME_VFS_MONITOR_EVENT_DELETED:
           handled = cached_dir_remove_subdir (dir, basename);
           break;
 
@@ -461,6 +464,7 @@
 
   g_free (basename);
   g_free (dirname);
+  g_free (path);
 
   if (handled)
     {
@@ -472,13 +476,23 @@
 cached_dir_ensure_monitor (CachedDir  *dir,
                            const char *dirname)
 {
-  if (dir->dir_monitor == NULL)
+  char *uri;
+
+  if (dir->monitor != NULL || dir->no_monitor_support)
+    return;
+
+  uri = gnome_vfs_get_uri_from_local_path (dirname);
+
+  if (gnome_vfs_monitor_add (&dir->monitor,
+                             uri,
+                             GNOME_VFS_MONITOR_DIRECTORY,
+                             (GnomeVFSMonitorCallback) handle_cached_dir_changed,
+                             dir) != GNOME_VFS_OK)
     {
-      dir->dir_monitor = menu_get_directory_monitor (dirname);
-      menu_monitor_add_notify (dir->dir_monitor,
-			       (MenuMonitorNotifyFunc) handle_cached_dir_changed,
-			       dir);
+      dir->no_monitor_support = TRUE;
     }
+
+  g_free (uri);
 }
 
 static gboolean
Index: libmenu/gmenu-tree.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/libmenu/gmenu-tree.c,v
retrieving revision 1.37
diff -u -r1.37 gmenu-tree.c
--- libmenu/gmenu-tree.c	25 Jul 2005 10:53:55 -0000	1.37
+++ libmenu/gmenu-tree.c	31 Aug 2005 16:40:21 -0000
@@ -23,9 +23,10 @@
 
 #include <string.h>
 #include <errno.h>
+#include <libgnomevfs/gnome-vfs.h>
+
 
 #include "menu-layout.h"
-#include "menu-monitor.h"
 #include "menu-util.h"
 #include "canonicalize.h"
 
@@ -261,24 +262,19 @@
   MENU_FILE_MONITOR_DIRECTORY
 } MenuFileMonitorType;
 
-typedef struct
-{
-  MenuFileMonitorType  type;
-  MenuMonitor         *monitor;
-} MenuFileMonitor;
-
 static void
-handle_nonexistent_menu_file_changed (MenuMonitor      *monitor,
-				      MenuMonitorEvent  event,
-				      const char       *path,
-				      GMenuTree        *tree)
+handle_nonexistent_menu_file_changed (GnomeVFSMonitorHandle     *handle,
+				      const char                *monitor_uri,
+				      const char                *info_uri,
+				      GnomeVFSMonitorEventType   event,
+				      GMenuTree                 *tree)
 {
-  if (event == MENU_MONITOR_EVENT_CHANGED ||
-      event == MENU_MONITOR_EVENT_CREATED)
+  if (event == GNOME_VFS_MONITOR_EVENT_CHANGED ||
+      event == GNOME_VFS_MONITOR_EVENT_CREATED)
     {
       menu_verbose ("\"%s\" %s, marking tree for recanonicalization\n",
-                    path,
-                    event == MENU_MONITOR_EVENT_CREATED ? "created" : "changed");
+                    info_uri,
+                    event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" : "changed");
 
       gmenu_tree_force_recanonicalize (tree);
       gmenu_tree_invoke_monitors (tree);
@@ -286,33 +282,45 @@
 }
 
 static void
-handle_menu_file_changed (MenuMonitor      *monitor,
-			  MenuMonitorEvent  event,
-			  const char       *path,
-                          GMenuTree        *tree)
-{
+handle_menu_file_changed (GnomeVFSMonitorHandle    *handle,
+                          const char               *monitor_uri,
+                          const char               *info_uri,
+                          GnomeVFSMonitorEventType  event,
+                          GMenuTree                *tree)
+{
+  if (event != GNOME_VFS_MONITOR_EVENT_DELETED &&
+      event != GNOME_VFS_MONITOR_EVENT_CHANGED &&
+      event != GNOME_VFS_MONITOR_EVENT_CREATED)
+    return;
+
   menu_verbose ("\"%s\" %s, marking tree for recanicalization\n",
-		path,
-		event == MENU_MONITOR_EVENT_CREATED ? "created" :
-		event == MENU_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
+		info_uri,
+		event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" :
+		event == GNOME_VFS_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
 
   gmenu_tree_force_recanonicalize (tree);
   gmenu_tree_invoke_monitors (tree);
 }
 
 static void
-handle_menu_file_directory_changed (MenuMonitor      *monitor,
-				    MenuMonitorEvent  event,
-				    const char       *path,
-				    GMenuTree        *tree)
-{
-  if (!g_str_has_suffix (path, ".menu"))
+handle_menu_file_directory_changed (GnomeVFSMonitorHandle    *handle,
+				    const char               *monitor_uri,
+				    const char               *info_uri,
+				    GnomeVFSMonitorEventType  event,
+				    GMenuTree                *tree)
+{
+  if (event != GNOME_VFS_MONITOR_EVENT_DELETED &&
+      event != GNOME_VFS_MONITOR_EVENT_CHANGED &&
+      event != GNOME_VFS_MONITOR_EVENT_CREATED)
+    return;
+
+  if (!g_str_has_suffix (info_uri, ".menu"))
     return;
 
   menu_verbose ("\"%s\" %s, marking tree for recanicalization\n",
-		path,
-		event == MENU_MONITOR_EVENT_CREATED ? "created" :
-		event == MENU_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
+		info_uri,
+		event == GNOME_VFS_MONITOR_EVENT_CREATED ? "created" :
+		event == GNOME_VFS_MONITOR_EVENT_CHANGED ? "changed" : "deleted");
 
   gmenu_tree_force_recanonicalize (tree);
   gmenu_tree_invoke_monitors (tree);
@@ -323,39 +331,44 @@
 				  const char          *path,
 				  MenuFileMonitorType  type)
 {
-  MenuFileMonitor *monitor;
+  GnomeVFSMonitorHandle *handle;
+  GnomeVFSResult         result;
+  char                  *uri;
 
-  monitor = g_new0 (MenuFileMonitor, 1);
+  uri = gnome_vfs_get_uri_from_local_path (path);
 
-  monitor->type = type;
+  handle = NULL;
 
   switch (type)
     {
     case MENU_FILE_MONITOR_FILE:
       menu_verbose ("Adding a menu file monitor for \"%s\"\n", path);
 
-      monitor->monitor = menu_get_file_monitor (path);
-      menu_monitor_add_notify (monitor->monitor,
-			       (MenuMonitorNotifyFunc) handle_menu_file_changed,
-			       tree);
+      result = gnome_vfs_monitor_add (&handle,
+				      uri,
+				      GNOME_VFS_MONITOR_FILE,
+				      (GnomeVFSMonitorCallback) handle_menu_file_changed,
+				      tree);
       break;
 
     case MENU_FILE_MONITOR_NONEXISTENT_FILE:
       menu_verbose ("Adding a menu file monitor for non-existent \"%s\"\n", path);
 
-      monitor->monitor = menu_get_file_monitor (path);
-      menu_monitor_add_notify (monitor->monitor,
-			       (MenuMonitorNotifyFunc) handle_nonexistent_menu_file_changed,
-			       tree);
+      result = gnome_vfs_monitor_add (&handle,
+				      uri,
+				      GNOME_VFS_MONITOR_FILE,
+				      (GnomeVFSMonitorCallback) handle_nonexistent_menu_file_changed,
+				      tree);
       break;
 
     case MENU_FILE_MONITOR_DIRECTORY:
       menu_verbose ("Adding a menu directory monitor for \"%s\"\n", path);
 
-      monitor->monitor = menu_get_directory_monitor (path);
-      menu_monitor_add_notify (monitor->monitor,
-			       (MenuMonitorNotifyFunc) handle_menu_file_directory_changed,
-			       tree);
+      result = gnome_vfs_monitor_add (&handle,
+				      uri,
+				      GNOME_VFS_MONITOR_DIRECTORY,
+				      (GnomeVFSMonitorCallback) handle_menu_file_directory_changed,
+				      tree);
       break;
 
     default:
@@ -363,44 +376,18 @@
       break;
     }
 
-  tree->menu_file_monitors = g_slist_prepend (tree->menu_file_monitors, monitor);
-}
-
-static void
-remove_menu_file_monitor (MenuFileMonitor *monitor,
-			  GMenuTree       *tree)
-{
-  switch (monitor->type)
+  if (result == GNOME_VFS_OK)
     {
-    case MENU_FILE_MONITOR_FILE:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_menu_file_changed,
-				  tree);
-      break;
-
-    case MENU_FILE_MONITOR_NONEXISTENT_FILE:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_nonexistent_menu_file_changed,
-				  tree);
-      break;
-
-    case MENU_FILE_MONITOR_DIRECTORY:
-      menu_monitor_remove_notify (monitor->monitor,
-				  (MenuMonitorNotifyFunc) handle_menu_file_directory_changed,
-				  tree);
-      break;
-
-    default:
-      g_assert_not_reached ();
-      break;
+      tree->menu_file_monitors = g_slist_prepend (tree->menu_file_monitors, handle);
+    }
+  else
+    {
+      g_assert (handle == NULL);
+      menu_verbose ("Failed to add monitor for %s: %s\n",
+                    path, gnome_vfs_result_to_string (result));
     }
 
-  menu_monitor_unref (monitor->monitor);
-  monitor->monitor = NULL;
-
-  monitor->type = MENU_FILE_MONITOR_INVALID;
-
-  g_free (monitor);
+  g_free (uri);
 }
 
 static void
@@ -409,8 +396,8 @@
   menu_verbose ("Removing all menu file monitors\n");
 
   g_slist_foreach (tree->menu_file_monitors,
-                   (GFunc) remove_menu_file_monitor,
-                   tree);
+                   (GFunc) gnome_vfs_monitor_cancel,
+                   NULL);
   g_slist_free (tree->menu_file_monitors);
   tree->menu_file_monitors = NULL;
 }
Index: python/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-menus/python/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- python/Makefile.am	22 Apr 2005 14:55:57 -0000	1.6
+++ python/Makefile.am	31 Aug 2005 16:40:21 -0000
@@ -5,7 +5,7 @@
 	-I$(srcdir)/../libmenu		\
 	$(WARN_CFLAGS)			\
 	$(NO_STRICT_ALIASING_CFLAGS)	\
-	$(GLIB_CFLAGS)			\
+	$(LIBMENU_CFLAGS)		\
 	$(PYTHON_INCLUDES)		\
 	$(DISABLE_DEPRECATED_CFLAGS)	\
 	$(DEBUG_CFLAGS)			\
@@ -15,5 +15,5 @@
 gmenu_LTLIBRARIES = gmenu.la
 
 gmenu_la_LDFLAGS = -module -avoid-version -fPIC -export-symbols-regex initgmenu
-gmenu_la_LIBADD  = $(GLIB_LIBS) $(top_builddir)/libmenu/libgnome-menu.la
+gmenu_la_LIBADD  = $(top_builddir)/libmenu/libgnome-menu.la
 gmenu_la_SOURCES = gmenu.c
Index: python/gmenu.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/python/gmenu.c,v
retrieving revision 1.8
diff -u -r1.8 gmenu.c
--- python/gmenu.c	5 May 2005 07:43:58 -0000	1.8
+++ python/gmenu.c	31 Aug 2005 16:40:21 -0000
@@ -21,6 +21,7 @@
 
 #include <Python.h>
 #include <gmenu-tree.h>
+#include <libgnomevfs/gnome-vfs-init.h>
 
 typedef struct
 {
@@ -1624,6 +1625,9 @@
 
   if (!PyArg_ParseTuple (args, "s|i:gmenu.lookup_tree", &menu_file, &flags))
     return NULL;
+
+  if (!gnome_vfs_initialized ())
+    gnome_vfs_init ();
 
   if (!(tree = gmenu_tree_lookup (menu_file, flags)))
     {
Index: util/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-menus/util/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- util/Makefile.am	20 Jul 2005 15:31:15 -0000	1.4
+++ util/Makefile.am	31 Aug 2005 16:40:21 -0000
@@ -4,7 +4,7 @@
 	-DGMENU_I_KNOW_THIS_IS_UNSTABLE				\
 	-DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"	\
 	-I$(srcdir)/../libmenu					\
-	$(GLIB_CFLAGS)						\
+	$(LIBMENU_CFLAGS)						\
 	$(DISABLE_DEPRECATED_CFLAGS)				\
 	$(DEBUG_CFLAGS)						\
 	$(WARN_CFLAGS)						\
@@ -20,5 +20,5 @@
 
 gnome_menu_spec_test_LDADD =		\
 	../libmenu/libgnome-menu.la	\
-	$(GLIB_LIBS)			\
+	$(LIBMENU_LIBS)			\
 	$(NULL)
Index: util/test-menu-spec.c
===================================================================
RCS file: /cvs/gnome/gnome-menus/util/test-menu-spec.c,v
retrieving revision 1.11
diff -u -r1.11 test-menu-spec.c
--- util/test-menu-spec.c	25 Jul 2005 10:53:55 -0000	1.11
+++ util/test-menu-spec.c	31 Aug 2005 16:40:22 -0000
@@ -23,6 +23,7 @@
 
 #include <glib/gi18n.h>
 #include <string.h>
+#include <libgnomevfs/gnome-vfs.h>
 
 static char     *menu_file = NULL;
 static gboolean  monitor = FALSE;
@@ -183,6 +184,8 @@
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
+  gnome_vfs_init ();
+
   options_context = g_option_context_new (_("- test GNOME's implementation of the Desktop Menu Specification"));
   g_option_context_add_main_entries (options_context, options, GETTEXT_PACKAGE);
   g_option_context_parse (options_context, &argc, &argv, NULL);
@@ -222,6 +225,8 @@
     }
 
   gmenu_tree_unref (tree);
+
+  gnome_vfs_shutdown ();
 
   return 0;
 }
