[Xfce4-commits] <xfdesktop:master> Use Garcon for menu generation. No monitoring yet.

Nick Schermer noreply at xfce.org
Sat Aug 28 16:30:01 CEST 2010


Updating branch refs/heads/master
         to 0b42e2a20ec32d4aa073ab883333fee8a5b5ba7d (commit)
       from 963c5e070452f496c2e0b52925b8b14e201ed638 (commit)

commit 0b42e2a20ec32d4aa073ab883333fee8a5b5ba7d
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Aug 27 17:00:00 2010 +0200

    Use Garcon for menu generation. No monitoring yet.
    
    Based on the port made by Jannis.
    
    Also move all the menu code in the xfdesktop src and remove
    the module and common code.

 Makefile.am                                        |    1 -
 common/Makefile.am                                 |   28 --
 common/desktop-menu-stub.c                         |  163 ---------
 common/desktop-menu-stub.h                         |   42 ---
 common/desktop-menu-utils.c                        |   75 ----
 common/desktop-menu-utils.h                        |   30 --
 configure.ac.in                                    |   13 +-
 modules/Makefile.am                                |    5 -
 modules/menu/Makefile.am                           |   43 ---
 src/Makefile.am                                    |   28 ++-
 src/main.c                                         |    1 -
 src/menu.c                                         |    4 +-
 .../menu/desktop-menu.c => src/xfce-desktop-menu.c |  374 ++++++--------------
 src/xfce-desktop-menu.h                            |   48 +++
 {modules/menu => src}/xfdesktop-app-menu-item.c    |    0
 {modules/menu => src}/xfdesktop-app-menu-item.h    |    0
 16 files changed, 192 insertions(+), 663 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index da4ea79..aaa0352 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,6 @@ SUBDIRS = \
 	po \
 	settings \
 	src \
-	modules \
 	pixmaps
 
 manpagedir = $(mandir)/man1
diff --git a/common/Makefile.am b/common/Makefile.am
index 9e7dfbf..b6145ba 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -8,31 +8,3 @@ libxfdesktop_la_CFLAGS = \
 	-I$(top_srcdir)/src \
 	$(LIBXFCE4UTIL_CFLAGS) \
 	$(GTK_CFLAGS)
-
-if BUILD_DESKTOP_MENU
-
-noinst_LTLIBRARIES += \
-	libxfdesktop-menu.la \
-	libxfdesktop-menu-utils.la
-
-libxfdesktop_menu_la_SOURCES = \
-	desktop-menu-stub.c \
-	desktop-menu-stub.h
-
-libxfdesktop_menu_la_CFLAGS = \
-	$(GMODULE_CFLAGS) \
-	$(GTK_CFLAGS) \
-	-DXFCEMODDIR=\"$(libdir)/xfce4/modules\"
-
-libxfdesktop_menu_utils_la_SOURCES = \
-	desktop-menu-utils.c \
-	desktop-menu-utils.h
-
-libxfdesktop_menu_utils_la_CFLAGS = \
-	$(LIBXFCE4UTIL_CFLAGS)
-
-endif
-
-if HAVE_CYGWIN
-  libxfdesktop_menu_la_LDFLAGS = -no-undefined
-endif
diff --git a/common/desktop-menu-stub.c b/common/desktop-menu-stub.c
deleted file mode 100644
index cebb2e9..0000000
--- a/common/desktop-menu-stub.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*  xfce4
- *  
- *  Copyright (C) 2004 Brian Tarricone <bjt23 at cornell.edu>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gmodule.h>
-
-#include "desktop-menu-stub.h"
-
-static GModule *_menu_module = NULL;
-static gint _menu_module_refcnt = 0;
-
-static XfceDesktopMenu *(*xfce_desktop_menu_new_p)(const gchar *menu_file, gboolean deferred) = NULL;
-GtkWidget *(*xfce_desktop_menu_get_widget)(XfceDesktopMenu *desktop_menu) = NULL;
-void (*xfce_desktop_menu_populate_menu)(XfceDesktopMenu *desktop_menu, GtkWidget *menu) = NULL;
-G_CONST_RETURN gchar *(*xfce_desktop_menu_get_menu_file)(XfceDesktopMenu *desktop_menu) = NULL;
-gboolean (*xfce_desktop_menu_need_update)(XfceDesktopMenu *desktop_menu) = NULL;
-void (*xfce_desktop_menu_start_autoregen)(XfceDesktopMenu *desktop_menu, guint delay) = NULL;
-void (*xfce_desktop_menu_stop_autoregen)(XfceDesktopMenu *desktop_menu) = NULL;
-void (*xfce_desktop_menu_force_regen)(XfceDesktopMenu *desktop_menu) = NULL;
-void (*xfce_desktop_menu_set_show_icons)(XfceDesktopMenu *desktop_menu, gboolean show_icons) = NULL;
-static void (*xfce_desktop_menu_destroy_p)(XfceDesktopMenu *desktop_menu) = NULL;
-
-static GQuark
-desktop_menu_error_quark(void)
-{
-    static GQuark q = 0;
-    
-    if(!q)
-        q = g_quark_from_static_string("xfce-desktop-menu-error-quark");
-    
-    return q;
-}
-
-static gboolean
-_setup_functions(GModule *module)
-{
-    if(!g_module_symbol(module, "xfce_desktop_menu_new_impl",
-            (gpointer)&xfce_desktop_menu_new_p))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_get_widget_impl",
-            (gpointer)&xfce_desktop_menu_get_widget))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_populate_menu_impl",
-            (gpointer)&xfce_desktop_menu_populate_menu))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_get_menu_file_impl",
-            (gpointer)&xfce_desktop_menu_get_menu_file))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_need_update_impl",
-            (gpointer)&xfce_desktop_menu_need_update))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_start_autoregen_impl",
-            (gpointer)&xfce_desktop_menu_start_autoregen))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_stop_autoregen_impl",
-            (gpointer)&xfce_desktop_menu_stop_autoregen))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_force_regen_impl",
-            (gpointer)&xfce_desktop_menu_force_regen))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_set_show_icons_impl",
-            (gpointer)&xfce_desktop_menu_set_show_icons))
-        return FALSE;
-    if(!g_module_symbol(module, "xfce_desktop_menu_destroy_impl",
-            (gpointer)&xfce_desktop_menu_destroy_p))
-        return FALSE;
-    
-    return TRUE;
-}
-
-static GModule *
-desktop_menu_stub_init(GError **err)
-{
-    GModule *module;
-    gchar *filename;
-
-    if(!g_module_supported()) {
-        if(err)
-            g_set_error(err, desktop_menu_error_quark(), 0,
-                    "Glib was not compiled with GModule support.");
-        return NULL;
-    }
-    
-/*    filename = g_module_build_path(XFCEMODDIR, "xfce4_desktop_menu");*/
-    filename = g_build_filename(XFCEMODDIR, "xfce4_desktop_menu." G_MODULE_SUFFIX, NULL);
-    module = g_module_open(filename, 0);
-    g_free(filename);
-    
-    if(!module) {
-        if(err) {
-            g_set_error(err, desktop_menu_error_quark(), 0,
-                    "The XfceDesktopMenu module could not be loaded: %s",
-                    g_module_error());
-        }
-        return NULL;
-    }
-    
-    if(!_setup_functions(module)) {
-        if(err) {
-            g_set_error(err, desktop_menu_error_quark(), 0,
-                    "The XfceDesktopMenu module is not valid: %s",
-                    g_module_error());
-        }
-        g_module_close(module);
-        return NULL;
-    }
-    
-    return module;
-}
-
-static void
-desktop_menu_stub_cleanup(GModule *module)
-{
-    g_module_close(module);
-}
-
-XfceDesktopMenu *
-xfce_desktop_menu_new(const gchar *menu_file, gboolean deferred)
-{
-    GError *err = NULL;
-    
-    if(_menu_module_refcnt == 0)
-        _menu_module = desktop_menu_stub_init(&err);
-    if(!_menu_module) {
-        g_critical("XfceDesktopMenu init failed (%s)",
-                err ? err->message : "Unknown error");
-        return NULL;
-    }
-    
-    _menu_module_refcnt++;
-    
-    return xfce_desktop_menu_new_p(menu_file, deferred);
-}
-
-void
-xfce_desktop_menu_destroy(XfceDesktopMenu *desktop_menu)
-{
-    xfce_desktop_menu_destroy_p(desktop_menu);
-    
-    if(--_menu_module_refcnt == 0) {
-        desktop_menu_stub_cleanup(_menu_module);
-        _menu_module = NULL;
-    }
-}
diff --git a/common/desktop-menu-stub.h b/common/desktop-menu-stub.h
deleted file mode 100644
index 52cfc91..0000000
--- a/common/desktop-menu-stub.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*  xfce4
- *  
- *  Copyright (C) 2004 Brian Tarricone <bjt23 at cornell.edu>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __DESKTOP_MENU_STUB_H__
-#define __DESKTOP_MENU_STUB_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _XfceDesktopMenu XfceDesktopMenu;
-
-XfceDesktopMenu *xfce_desktop_menu_new(const gchar *menu_file, gboolean deferred);
-extern GtkWidget *(*xfce_desktop_menu_get_widget)(XfceDesktopMenu *desktop_menu);
-extern void (*xfce_desktop_menu_populate_menu)(XfceDesktopMenu *desktop_menu, GtkWidget *menu);
-extern G_CONST_RETURN gchar *(*xfce_desktop_menu_get_menu_file)(XfceDesktopMenu *desktop_menu);
-extern gboolean (*xfce_desktop_menu_need_update)(XfceDesktopMenu *desktop_menu);
-extern void (*xfce_desktop_menu_start_autoregen)(XfceDesktopMenu *desktop_menu, guint delay);
-extern void (*xfce_desktop_menu_stop_autoregen)(XfceDesktopMenu *desktop_menu);
-extern void (*xfce_desktop_menu_force_regen)(XfceDesktopMenu *desktop_menu);
-extern void (*xfce_desktop_menu_set_show_icons)(XfceDesktopMenu *desktop_menu, gboolean show_icons);
-void xfce_desktop_menu_destroy(XfceDesktopMenu *desktop_menu);
-
-G_END_DECLS
-
-#endif /* !def __DESKTOP_MENU_STUB_H__ */
diff --git a/common/desktop-menu-utils.c b/common/desktop-menu-utils.c
deleted file mode 100644
index 1c23c8e..0000000
--- a/common/desktop-menu-utils.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *  Copyright (c) 2004-2007 Brian Tarricone <bjt23 at cornell.edu>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <libxfce4util/libxfce4util.h>
-
-#include "desktop-menu-utils.h"
-
-gchar *
-xfce_desktop_get_menufile(void)
-{
-    XfceKiosk *kiosk;
-    gboolean user_menu;
-    gchar *menu_file = NULL;
-    gchar **all_dirs;
-    const gchar *userhome = xfce_get_homedir();
-    gint i;
-
-    kiosk = xfce_kiosk_new("xfdesktop");
-    user_menu = xfce_kiosk_query(kiosk, "UserMenu");
-    xfce_kiosk_free(kiosk);
-    
-    if(user_menu) {
-        gchar *file = xfce_resource_save_location(XFCE_RESOURCE_CONFIG,
-                                                  "menus/xfce-applications.menu",
-                                                  FALSE);
-        if(file) {
-            DBG("checking %s", file);
-            if(g_file_test(file, G_FILE_TEST_IS_REGULAR))
-                return file;
-            else
-                g_free(file);
-        }
-    }
-    
-    all_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_CONFIG,
-                                        "menus/xfce-applications.menu");
-    for(i = 0; all_dirs[i]; i++) {
-        DBG("checking %s", all_dirs[i]);
-        if(user_menu || strstr(all_dirs[i], userhome) != all_dirs[i]) {
-            if(g_file_test(all_dirs[i], G_FILE_TEST_IS_REGULAR)) {
-                menu_file = g_strdup(all_dirs[i]);
-                break;
-            }
-        }
-    }
-    g_strfreev(all_dirs);
-
-    if(!menu_file)
-        g_warning("%s: Could not locate a menu definition file", PACKAGE);
-
-    return menu_file;
-}
diff --git a/common/desktop-menu-utils.h b/common/desktop-menu-utils.h
deleted file mode 100644
index b6da4b6..0000000
--- a/common/desktop-menu-utils.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *  Copyright (c) 2004-2007 Brian Tarricone <bjt23 at cornell.edu>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __DESKTOP_MENU_UTILS_H__
-#define __DESKTOP_MENU_UTILS_H__
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-gchar *xfce_desktop_get_menufile(void);
-
-G_END_DECLS
-
-#endif  /* __DESKTOP_MENU_UTILS_H__ */
diff --git a/configure.ac.in b/configure.ac.in
index 644a83a..2cd14d8 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -18,7 +18,7 @@ m4_define([gtk_minimum_version], [2.14.0])
 m4_define([libxfce4util_minimum_version], [4.6.0])
 m4_define([libxfce4ui_minimum_version], [4.7.0])
 m4_define([xfce_minimum_version], [4.6.0])
-m4_define([xfce4menu_minimum_version], [4.6.0])
+m4_define([garcon_minimum_version], [0.1.1])
 m4_define([exo_minimum_version], [0.3.100])
 m4_define([thunar_minimum_version], [1.0.0])
 m4_define([dbus_minimum_version], [0.34])
@@ -44,6 +44,7 @@ AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""])
 
 dnl check for basic programs
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
 AC_PROG_INTLTOOL([intltool_minimum_version], [no-xml])
@@ -152,12 +153,12 @@ if test "x$ac_cv_enable_desktop_menu" = "xno"; then
     build_desktop_menu="no"
 else
     dnl time for more abuse!
-    XDT_CHECK_PACKAGE([LIBXFCE4MENU], [libxfce4menu-0.1],
-                      [xfce4menu_minimum_version], [build_desktop_menu="yes"],
+    XDT_CHECK_PACKAGE([GARCON], [garcon-1],
+                      [garcon_minimum_version], [build_desktop_menu="yes"],
                       [
-echo "*** Optional package libxfce4menu-0.1 was either not found on your system"
+echo "*** Optional package garcon-1 was either not found on your system"
 echo "*** or is too old.  Please install or upgrade to at least version"
-echo "*** xfce4menu_minimum_version, or adjust the PKG_CONFIG_PATH environment variable"
+echo "*** garcon_minimum_version, or adjust the PKG_CONFIG_PATH environment variable"
 echo "*** if you installed the new version of the package in a nonstandard"
 echo "*** prefix.  Desktop menu will be disabled."
 build_desktop_menu="no"
@@ -243,8 +244,6 @@ doc/manual/images/Makefile
 doc/manual/images/fr/Makefile
 doc/manual/images/ja/Makefile
 doc/manual/po/Makefile
-modules/Makefile
-modules/menu/Makefile
 pixmaps/Makefile
 po/Makefile.in
 settings/Makefile
diff --git a/modules/Makefile.am b/modules/Makefile.am
deleted file mode 100644
index 52eb02f..0000000
--- a/modules/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-SUBDIRS = 
-
-if BUILD_DESKTOP_MENU
-SUBDIRS += menu
-endif
diff --git a/modules/menu/Makefile.am b/modules/menu/Makefile.am
deleted file mode 100644
index ab509c2..0000000
--- a/modules/menu/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-plugindir = $(libdir)/xfce4/modules
-
-plugin_LTLIBRARIES = xfce4_desktop_menu.la
-
-xfce4_desktop_menu_la_SOURCES = \
-	desktop-menu.c \
-	xfdesktop-app-menu-item.c \
-	xfdesktop-app-menu-item.h
-
-xfce4_desktop_menu_la_CFLAGS = \
-	-I$(top_srcdir)/common \
-	$(GMODULE_CFLAGS) \
-	$(GTHREAD_CFLAGS) \
-	$(LIBXFCE4MENU_CFLAGS) \
-	$(LIBX11_CFLAGS) \
-	$(LIBXFCE4UI_CFLAGS) \
-	$(THUNAR_VFS_CFLAGS) \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
-	-DDATADIR=\"$(datadir)\" \
-	-DBINDIR=\"$(bindir)\"
-
-xfce4_desktop_menu_la_DEPENDENCIES = \
-	$(top_builddir)/common/libxfdesktop-menu-utils.la
-
-xfce4_desktop_menu_la_LDFLAGS = \
-	-export-dynamic \
-	-avoid-version \
-	-module
-
-if HAVE_CYGWIN
-xfce4_desktop_menu_la_LDFLAGS += \
-	-no-undefined
-endif
-
-xfce4_desktop_menu_la_LIBADD = \
-	$(top_builddir)/common/libxfdesktop-menu-utils.la \
-	$(GMODULE_LIBS) \
-	$(GTHREAD_LIBS) \
-	$(LIBXFCE4MENU_LIBS) \
-	$(LIBX11_LDFLAGS) \
-	$(LIBX11_LIBS) \
-	$(LIBXFCE4UI_LIBS) \
-	$(THUNAR_VFS_LIBS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 43bdd49..b971a9d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,6 +27,12 @@ desktop_icon_sources = \
 	xfdesktop-window-icon-manager.c \
 	xfdesktop-window-icon-manager.h
 
+desktop_menu_sources = \
+	xfce-desktop-menu.c \
+	xfce-desktop-menu.h \
+	xfdesktop-app-menu-item.c \
+	xfdesktop-app-menu-item.h
+
 desktop_file_icon_sources = \
 	xfdesktop-clipboard-manager.c \
 	xfdesktop-clipboard-manager.h \
@@ -58,22 +64,18 @@ xfdesktop_CFLAGS = \
 	-DXFCEMODDIR=\"$(libdir)/xfce4/modules\" \
 	$(LIBX11_CFLAGS)	\
 	$(GTHREAD_CFLAGS) \
-	$(GMODULE_CFLAGS) \
 	$(LIBXFCE4UTIL_CFLAGS) \
 	$(LIBXFCE4UI_CFLAGS) \
 	$(LIBXFCE4SMCLIENT_PRIVATE_CFLAGS) \
 	$(LIBWNCK_CFLAGS) \
-	$(XFCONF_CFLAGS)
+	$(XFCONF_CFLAGS) \
+	$(GARCON_CFLAGS)
 
 xfdesktop_LDFLAGS = \
 	-export-dynamic
 
 # cygwin link order requires this split
 xfdesktop_LDADD = $(top_builddir)/common/libxfdesktop.la
-if BUILD_DESKTOP_MENU
-  xfdesktop_LDADD += $(top_builddir)/common/libxfdesktop-menu.la
-  xfdesktop_DEPENDENCIES = $(top_builddir)/common/libxfdesktop-menu.la
-endif
 xfdesktop_LDADD += \
 	$(LIBX11_LDFLAGS) \
 	$(LIBX11_LIBS) \
@@ -82,7 +84,18 @@ xfdesktop_LDADD += \
 	$(LIBXFCE4UI_LIBS) \
 	$(LIBXFCE4SMCLIENT_PRIVATE_LIBS) \
 	$(LIBWNCK_LIBS) \
-	$(XFCONF_LIBS)
+	$(XFCONF_LIBS) \
+	$(GARCON_LIBS)
+
+if BUILD_DESKTOP_MENU
+xfdesktop_SOURCES += $(desktop_menu_sources)
+
+xfdesktop_CFLAGS += \
+	$(GARCON_CFLAGS)
+
+xfdesktop_LDADD += \
+	$(GARCON_LIBS)
+endif
 
 if ENABLE_DESKTOP_ICONS
 
@@ -182,6 +195,7 @@ endif
 endif
 
 EXTRA_DIST = \
+	$(desktop_menu_sources) \
 	$(desktop_icon_sources) \
 	$(desktop_file_icon_sources) \
 	xfdesktop-marshal.list
diff --git a/src/main.c b/src/main.c
index 1237abd..de5cf2c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,7 +50,6 @@
 
 #include <X11/Xlib.h>
 
-#include <gmodule.h>
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
diff --git a/src/menu.c b/src/menu.c
index e9fc99c..4376d27 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -31,15 +31,13 @@
 #endif
 
 #include <glib.h>
-#include <gmodule.h>
 #include <gtk/gtk.h>
 
 #include <libxfce4util/libxfce4util.h>
 
 #include "menu.h"
 #ifdef USE_DESKTOP_MENU
-#include "desktop-menu-stub.h"
-#include "xfdesktop-common.h"
+#include "xfce-desktop-menu.h"
 #endif
 
 #ifdef USE_DESKTOP_MENU
diff --git a/modules/menu/desktop-menu.c b/src/xfce-desktop-menu.c
similarity index 52%
rename from modules/menu/desktop-menu.c
rename to src/xfce-desktop-menu.c
index 6e75648..e798813 100644
--- a/modules/menu/desktop-menu.c
+++ b/src/xfce-desktop-menu.c
@@ -4,6 +4,7 @@
  *                     2003 Biju Chacko (botsie at users.sourceforge.net)
  *                     2004 Danny Milosavljevic <danny.milo at gmx.net>
  *                2004-2008 Brian Tarricone <bjt23 at cornell.edu>
+ *                     2009 Jannis Pohlmann <jannis at xfce.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -56,23 +57,19 @@
 
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
-#include <gmodule.h>
 #include <glib.h>
 
+#include <garcon/garcon.h>
+
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4ui/libxfce4ui.h>
-#include <libxfce4menu/libxfce4menu.h>
-
-#ifdef HAVE_THUNAR_VFS
-#include <thunar-vfs/thunar-vfs.h>
-#endif
 
-#include "desktop-menu-utils.h"
+#include "xfce-desktop-menu.h"
 #include "xfdesktop-app-menu-item.h"
 
-typedef struct
+struct _XfceDesktopMenu
 {
-	XfceMenu *xfce_menu;
+    GarconMenu *garcon_menu;
 
     gboolean cache_menu_items;
     GList *menu_item_cache;
@@ -82,40 +79,16 @@ typedef struct
     gboolean use_menu_icons;  /* show menu icons? */
 	
     gint idle_id;  /* source id for idled generation */
-    
-#ifdef HAVE_THUNAR_VFS
-    GList *monitors;
-#endif
-} XfceDesktopMenu;
-
-
-/* silence some warnings... */
-G_MODULE_EXPORT XfceDesktopMenu *xfce_desktop_menu_new_impl(const gchar *menu_file,
-                                                            gboolean deferred);
-G_MODULE_EXPORT void xfce_desktop_menu_populate_menu_impl(XfceDesktopMenu *desktop_menu,
-                                                          GtkWidget *menu);
-G_MODULE_EXPORT GtkWidget *xfce_desktop_menu_get_widget_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT G_CONST_RETURN gchar *xfce_desktop_menu_get_menu_file_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT gboolean xfce_desktop_menu_need_update_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT void xfce_desktop_menu_start_autoregen_impl(XfceDesktopMenu *desktop_menu,
-                                                            guint delay);
-G_MODULE_EXPORT void xfce_desktop_menu_stop_autoregen_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT void xfce_desktop_menu_force_regen_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT void xfce_desktop_menu_set_show_icons_impl(XfceDesktopMenu *desktop_menu,
-                                                           gboolean show_icons);
-G_MODULE_EXPORT void xfce_desktop_menu_destroy_impl(XfceDesktopMenu *desktop_menu);
-G_MODULE_EXPORT gchar *g_module_check_init(GModule *module);
+};
 
 
 static void _xfce_desktop_menu_free_menudata(XfceDesktopMenu *desktop_menu);
-
-static gint _xfce_desktop_menu_icon_size = 24;
 static GtkIconTheme *_deskmenu_icon_theme = NULL;
 
 static gboolean _generate_menu_idled(gpointer data);
 static gboolean _generate_menu(XfceDesktopMenu *desktop_menu);
 static void desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
-                                   XfceMenu *xfce_menu,
+                                   GarconMenu *garcon_menu,
                                    GtkWidget *menu,
                                    GList **menu_items_return);
 
@@ -135,112 +108,6 @@ itheme_changed_cb(GtkIconTheme *itheme, gpointer user_data)
         desktop_menu->idle_id = g_idle_add(_generate_menu_idled, desktop_menu);
 }
 
-#ifdef HAVE_THUNAR_VFS
-
-static void
-desktop_menu_something_changed(ThunarVfsMonitor *monitor,
-                               ThunarVfsMonitorHandle *handle,
-                               ThunarVfsMonitorEvent event,
-                               ThunarVfsPath *handle_path,
-                               ThunarVfsPath *event_path,
-                               gpointer user_data)
-{
-    XfceDesktopMenu *desktop_menu = user_data;
-    const gchar *filename;
-    XfceMenuItemCache *cache = xfce_menu_item_cache_get_default();
-    
-#ifdef DEBUG
-    {
-        gchar buf[1024];
-        thunar_vfs_path_to_string(event_path, buf, sizeof(buf), NULL);
-        TRACE("entering (%d,%s)", event, buf);
-    }
-#endif
-
-    /* bug #4979: only trigger on files we care about */
-    filename = thunar_vfs_path_get_name(event_path);
-    if(!g_str_has_suffix(filename, ".desktop")
-       && !g_str_has_suffix(filename, ".menu")
-       && !g_str_has_suffix(filename, ".directory"))
-    {
-        DBG("menu: ignoring change on \"%s\"", filename);
-        return;
-    }
-    
-    xfce_menu_item_cache_invalidate(cache);
-    if(!desktop_menu->idle_id)
-        desktop_menu->idle_id = g_idle_add(_generate_menu_idled, desktop_menu);
-}
-
-#if 0
-static gpointer
-desktop_menu_xfce_menu_monitor_file(XfceMenu *menu,
-                                    const gchar *filename,
-                                    gpointer user_data)
-{
-    XfceDesktopMenu *desktop_menu = user_data;
-    ThunarVfsPath *path;
-    ThunarVfsMonitor *monitor = thunar_vfs_monitor_get_default();
-    ThunarVfsMonitorHandle *mhandle = NULL;
-    
-    path = thunar_vfs_path_new(filename, NULL);
-    if(path) {
-        mhandle = thunar_vfs_monitor_add_file(monitor, path,
-                                              desktop_menu_something_changed,
-                                              desktop_menu);
-        thunar_vfs_path_unref(path);
-    }
-    
-    g_object_unref(G_OBJECT(monitor));
-    
-    TRACE("exiting (%s), returning 0x%p\n", filename, mhandle);
-    
-    return mhandle;
-}
-#endif
-
-static gpointer
-desktop_menu_xfce_menu_monitor_directory(XfceMenu *menu,
-                                         const gchar *filename,
-                                         gpointer user_data)
-{
-    XfceDesktopMenu *desktop_menu = user_data;
-    ThunarVfsPath *path;
-    ThunarVfsMonitorHandle *mhandle = NULL;
-    
-    if(!g_file_test(filename, G_FILE_TEST_IS_DIR))
-        return NULL;
-    
-    path = thunar_vfs_path_new(filename, NULL);
-    if(path) {
-        ThunarVfsMonitor *monitor = thunar_vfs_monitor_get_default();
-        mhandle = thunar_vfs_monitor_add_directory(monitor, path,
-                                                   desktop_menu_something_changed,
-                                                   desktop_menu);
-        thunar_vfs_path_unref(path);
-        g_object_unref(G_OBJECT(monitor));
-    }
-    
-    TRACE("exiting (%s), returning 0x%p", filename, mhandle);
-    
-    return mhandle;
-}
-
-static void
-desktop_menu_xfce_menu_remove_monitor(XfceMenu *menu,
-                                      gpointer monitor_handle)
-{
-    ThunarVfsMonitor *monitor = thunar_vfs_monitor_get_default();
-    ThunarVfsMonitorHandle *mhandle = monitor_handle;
-    
-    TRACE("entering (0x%p)", mhandle); 
-    
-    thunar_vfs_monitor_remove(monitor, mhandle);
-    g_object_unref(G_OBJECT(monitor));
-}
-
-#endif
-
 /*
  * this is a bit of a kludge.  in order to support the cache and be a bit
  * faster, we either want to build a GtkMenu, or we want to just build
@@ -249,49 +116,40 @@ desktop_menu_xfce_menu_remove_monitor(XfceMenu *menu,
  */
 static void
 desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
-                       XfceMenu *xfce_menu,
+                       GarconMenu *garcon_menu,
                        GtkWidget *menu,
                        GList **menu_items_return)
 {
-    GSList *items, *l;
+    GList *items, *l;
     GtkWidget *submenu, *mi, *img;
-    XfceMenu *xfce_submenu;
-    XfceMenuDirectory *xfce_directory;
-    XfceMenuItem *xfce_item;
+    GarconMenu *garcon_submenu;
+    GarconMenuDirectory *garcon_directory;
+    GarconMenuItem *garcon_item;
     const gchar *name, *icon_name;
 
     g_return_if_fail((menu && !menu_items_return)
                      || (!menu && menu_items_return));
     
-    if(xfce_menu_has_layout(xfce_menu))
-        items = xfce_menu_get_layout_elements(xfce_menu);
-    else {
-        items = xfce_menu_get_menus(xfce_menu);
-        items = g_slist_concat(items, xfce_menu_get_items(xfce_menu));
-    }
+    items = garcon_menu_get_elements(garcon_menu);
     for(l = items; l; l = l->next) {
-        if(XFCE_IS_MENU(l->data)) {
+        if(!garcon_menu_element_get_visible(l->data))
+            continue;
+
+        if(GARCON_IS_MENU(l->data)) {
             GList *tmpl;
-            xfce_submenu = l->data;
-            xfce_directory = xfce_menu_get_directory(xfce_submenu);
+            garcon_submenu = l->data;
+            garcon_directory = garcon_menu_get_directory(garcon_submenu);
             icon_name = NULL;
             
-            if(xfce_directory
-               && (xfce_menu_directory_get_no_display(xfce_directory)
-               || !xfce_menu_directory_show_in_environment(xfce_directory)))
-            {
-                continue;
-            }
-            
             submenu = gtk_menu_new();
             gtk_widget_show(submenu);
             
-            if(xfce_directory) {
+            if(garcon_directory) {
                 if(desktop_menu->use_menu_icons)
-                    icon_name = xfce_menu_directory_get_icon(xfce_directory);
+                    icon_name = garcon_menu_directory_get_icon_name(garcon_directory);
             }
             
-            name = xfce_menu_element_get_name(XFCE_MENU_ELEMENT(xfce_submenu));
+            name = garcon_menu_element_get_name(GARCON_MENU_ELEMENT(garcon_submenu));
 
             mi = gtk_image_menu_item_new_with_label(name);
             if(icon_name) {
@@ -308,7 +166,7 @@ desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
             else
                 *menu_items_return = g_list_prepend(*menu_items_return, mi);
             
-            desktop_menu_add_items(desktop_menu, xfce_submenu,
+            desktop_menu_add_items(desktop_menu, garcon_submenu,
                                    submenu, NULL);
             
             /* we have to check emptiness down here instead of at the top of the
@@ -317,7 +175,7 @@ desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
                 gtk_widget_destroy(mi);
             else
                 g_list_free(tmpl);
-        } else if(XFCE_IS_MENU_SEPARATOR(l->data)) {
+        } else if(GARCON_IS_MENU_SEPARATOR(l->data)) {
             mi = gtk_separator_menu_item_new();
             gtk_widget_show(mi);
 
@@ -325,22 +183,16 @@ desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
                 gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
             else
                 *menu_items_return = g_list_prepend(*menu_items_return, mi);
-        } else if(XFCE_IS_MENU_ITEM(l->data)) {
-            xfce_item = l->data;
-            
-            if(xfce_menu_item_get_no_display(xfce_item)
-               || !xfce_menu_item_show_in_environment(xfce_item))
-            {
-                continue;
-            }
+        } else if(GARCON_IS_MENU_ITEM(l->data)) {
+            garcon_item = l->data;
             
-            mi = xfdesktop_app_menu_item_new_full(xfce_menu_element_get_name(XFCE_MENU_ELEMENT(xfce_item)),
-                                                  xfce_menu_item_get_command(xfce_item),
+            mi = xfdesktop_app_menu_item_new_full(garcon_menu_element_get_name(GARCON_MENU_ELEMENT(garcon_item)),
+                                                  garcon_menu_item_get_command(garcon_item),
                                                   desktop_menu->use_menu_icons
-                                                    ? xfce_menu_item_get_icon_name(xfce_item)
+                                                    ? garcon_menu_item_get_icon_name(garcon_item)
                                                     : NULL,
-                                                  xfce_menu_item_requires_terminal(xfce_item),
-                                                  xfce_menu_item_supports_startup_notification(xfce_item));
+                                                  garcon_menu_item_requires_terminal(garcon_item),
+                                                  garcon_menu_item_supports_startup_notification(garcon_item));
             gtk_widget_show(mi);
 
             if(menu)
@@ -349,7 +201,7 @@ desktop_menu_add_items(XfceDesktopMenu *desktop_menu,
                 *menu_items_return = g_list_prepend(*menu_items_return, mi);
         }
     }
-    g_slist_free(items);
+    g_list_free(items);
 
     if(menu_items_return)
         *menu_items_return = g_list_reverse(*menu_items_return);
@@ -376,22 +228,18 @@ _generate_menu(XfceDesktopMenu *desktop_menu)
     
     DBG("menu file name is %s", desktop_menu->filename);
 
-#if 0
-    /* this is kinda lame, but xfcemenu currently caches too much */
-    xfce_menu_shutdown();
-    xfce_menu_init("XFCE");
-#endif
-    
-    desktop_menu->xfce_menu = xfce_menu_new(desktop_menu->filename, &error);
-    if(!desktop_menu->xfce_menu) {
-        g_critical("Unable to create XfceMenu from file '%s': %s",
+    desktop_menu->garcon_menu = garcon_menu_new_for_path(desktop_menu->filename);
+
+    if(!garcon_menu_load (desktop_menu->garcon_menu, NULL, &error)) {
+        g_critical("Unable to create GarconMenu from file '%s': %s",
                    desktop_menu->filename, error->message);
         g_error_free(error);
+        _xfce_desktop_menu_free_menudata(desktop_menu);
         return FALSE;
     }
 
     if(desktop_menu->cache_menu_items) {
-        desktop_menu_add_items(desktop_menu, desktop_menu->xfce_menu,
+        desktop_menu_add_items(desktop_menu, desktop_menu->garcon_menu,
                                NULL, &desktop_menu->menu_item_cache);
     }
 
@@ -408,12 +256,12 @@ _xfce_desktop_menu_free_menudata(XfceDesktopMenu *desktop_menu)
         desktop_menu->menu_item_cache = NULL;
     }
 
-    if(desktop_menu->xfce_menu) {
-        g_object_unref(G_OBJECT(desktop_menu->xfce_menu));
-        desktop_menu->xfce_menu = NULL;
+    if(desktop_menu->garcon_menu) {
+        g_object_unref(G_OBJECT(desktop_menu->garcon_menu));
+        desktop_menu->garcon_menu = NULL;
     }
     
-    desktop_menu->xfce_menu = NULL;
+    desktop_menu->garcon_menu = NULL;
 }
 
 static gboolean
@@ -435,22 +283,62 @@ desktop_menu_recache(gpointer data,
 {
     XfceDesktopMenu *desktop_menu = data;
     if(!desktop_menu->menu_item_cache) {
-        desktop_menu_add_items(desktop_menu, desktop_menu->xfce_menu,
+        desktop_menu_add_items(desktop_menu, desktop_menu->garcon_menu,
                                NULL, &desktop_menu->menu_item_cache);
     }
 }
 
-G_MODULE_EXPORT XfceDesktopMenu *
-xfce_desktop_menu_new_impl(const gchar *menu_file,
+static gchar *
+xfce_desktop_get_menufile(void)
+{
+    XfceKiosk *kiosk;
+    gboolean user_menu;
+    gchar *menu_file = NULL;
+    gchar **all_dirs;
+    const gchar *userhome = xfce_get_homedir();
+    gint i;
+
+    kiosk = xfce_kiosk_new("xfdesktop");
+    user_menu = xfce_kiosk_query(kiosk, "UserMenu");
+    xfce_kiosk_free(kiosk);
+    
+    if(user_menu) {
+        gchar *file = xfce_resource_save_location(XFCE_RESOURCE_CONFIG,
+                                                  "menus/xfce-applications.menu",
+                                                  FALSE);
+        if(file) {
+            DBG("checking %s", file);
+            if(g_file_test(file, G_FILE_TEST_IS_REGULAR))
+                return file;
+            else
+                g_free(file);
+        }
+    }
+    
+    all_dirs = xfce_resource_lookup_all(XFCE_RESOURCE_CONFIG,
+                                        "menus/xfce-applications.menu");
+    for(i = 0; all_dirs[i]; i++) {
+        DBG("checking %s", all_dirs[i]);
+        if(user_menu || strstr(all_dirs[i], userhome) != all_dirs[i]) {
+            if(g_file_test(all_dirs[i], G_FILE_TEST_IS_REGULAR)) {
+                menu_file = g_strdup(all_dirs[i]);
+                break;
+            }
+        }
+    }
+    g_strfreev(all_dirs);
+
+    if(!menu_file)
+        g_warning("%s: Could not locate a menu definition file", PACKAGE);
+
+    return menu_file;
+}
+
+
+XfceDesktopMenu *
+xfce_desktop_menu_new(const gchar *menu_file,
                            gboolean deferred)
 {
-#ifdef HAVE_THUNAR_VFS
-    static XfceMenuMonitorVTable monitor_vtable = {
-        NULL, /*desktop_menu_xfce_menu_monitor_file,*/
-        desktop_menu_xfce_menu_monitor_directory,
-        desktop_menu_xfce_menu_remove_monitor
-    };
-#endif
     XfceDesktopMenu *desktop_menu = g_new0(XfceDesktopMenu, 1);
     
     desktop_menu->use_menu_icons = TRUE;
@@ -461,18 +349,10 @@ xfce_desktop_menu_new_impl(const gchar *menu_file,
     else
         desktop_menu->filename = xfce_desktop_get_menufile();
     
-#ifdef HAVE_THUNAR_VFS
-    thunar_vfs_init();
-    xfce_menu_monitor_set_vtable(&monitor_vtable, desktop_menu);
-#endif
-    
     if(deferred)
         desktop_menu->idle_id = g_idle_add(_generate_menu_idled, desktop_menu);
     else {
         if(!_generate_menu(desktop_menu)) {
-#ifdef HAVE_THUNAR_VFS
-            xfce_menu_monitor_set_vtable(NULL, NULL);
-#endif
             g_free(desktop_menu);
             desktop_menu = NULL;
         }
@@ -484,19 +364,19 @@ xfce_desktop_menu_new_impl(const gchar *menu_file,
     return desktop_menu;
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_populate_menu_impl(XfceDesktopMenu *desktop_menu,
+void
+xfce_desktop_menu_populate_menu(XfceDesktopMenu *desktop_menu,
                                      GtkWidget *menu)
 {
     g_return_if_fail(desktop_menu && menu);
     
-    if(!desktop_menu->xfce_menu) {
+    if(!desktop_menu->garcon_menu) {
         if(desktop_menu->idle_id) {
             g_source_remove(desktop_menu->idle_id);
             desktop_menu->idle_id = 0;
         }
         _generate_menu(desktop_menu);
-        if(!desktop_menu->xfce_menu)
+        if(!desktop_menu->garcon_menu)
             return;
     }
 
@@ -509,13 +389,13 @@ xfce_desktop_menu_populate_menu_impl(XfceDesktopMenu *desktop_menu,
         g_object_weak_ref(G_OBJECT(menu), desktop_menu_recache,
                           desktop_menu);
     } else {
-        desktop_menu_add_items(desktop_menu, desktop_menu->xfce_menu,
+        desktop_menu_add_items(desktop_menu, desktop_menu->garcon_menu,
                                GTK_WIDGET(menu), NULL);
     }
 }
 
-G_MODULE_EXPORT GtkWidget *
-xfce_desktop_menu_get_widget_impl(XfceDesktopMenu *desktop_menu)
+GtkWidget *
+xfce_desktop_menu_get_widget(XfceDesktopMenu *desktop_menu)
 {
     GtkWidget *menu;
     
@@ -523,9 +403,9 @@ xfce_desktop_menu_get_widget_impl(XfceDesktopMenu *desktop_menu)
     
     menu = gtk_menu_new();
     
-    xfce_desktop_menu_populate_menu_impl(desktop_menu, menu);
+    xfce_desktop_menu_populate_menu(desktop_menu, menu);
     
-    if(!desktop_menu->xfce_menu) {
+    if(!desktop_menu->garcon_menu) {
         gtk_widget_destroy(menu);
         return NULL;
     }
@@ -533,35 +413,35 @@ xfce_desktop_menu_get_widget_impl(XfceDesktopMenu *desktop_menu)
     return menu;
 }
 
-G_MODULE_EXPORT G_CONST_RETURN gchar *
-xfce_desktop_menu_get_menu_file_impl(XfceDesktopMenu *desktop_menu)
+G_CONST_RETURN gchar *
+xfce_desktop_menu_get_menu_file(XfceDesktopMenu *desktop_menu)
 {
     g_return_val_if_fail(desktop_menu != NULL, NULL);
     
     return desktop_menu->filename;
 }
 
-G_MODULE_EXPORT gboolean
-xfce_desktop_menu_need_update_impl(XfceDesktopMenu *desktop_menu)
+gboolean
+xfce_desktop_menu_need_update(XfceDesktopMenu *desktop_menu)
 {
     return FALSE;
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_start_autoregen_impl(XfceDesktopMenu *desktop_menu,
+void
+xfce_desktop_menu_start_autoregen(XfceDesktopMenu *desktop_menu,
                                        guint delay)
 {
     /* noop */
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_stop_autoregen_impl(XfceDesktopMenu *desktop_menu)
+void
+xfce_desktop_menu_stop_autoregen(XfceDesktopMenu *desktop_menu)
 {
     /* noop */
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_force_regen_impl(XfceDesktopMenu *desktop_menu)
+void
+xfce_desktop_menu_force_regen(XfceDesktopMenu *desktop_menu)
 {
     TRACE("dummy");
     g_return_if_fail(desktop_menu != NULL);
@@ -574,8 +454,8 @@ xfce_desktop_menu_force_regen_impl(XfceDesktopMenu *desktop_menu)
     _generate_menu(desktop_menu);
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_set_show_icons_impl(XfceDesktopMenu *desktop_menu,
+void
+xfce_desktop_menu_set_show_icons(XfceDesktopMenu *desktop_menu,
                                       gboolean show_icons)
 {
     g_return_if_fail(desktop_menu != NULL);
@@ -590,16 +470,12 @@ xfce_desktop_menu_set_show_icons_impl(XfceDesktopMenu *desktop_menu,
     }
 }
 
-G_MODULE_EXPORT void
-xfce_desktop_menu_destroy_impl(XfceDesktopMenu *desktop_menu)
+void
+xfce_desktop_menu_destroy(XfceDesktopMenu *desktop_menu)
 {
     g_return_if_fail(desktop_menu != NULL);
     TRACE("dummy");
     
-#ifdef HAVE_THUNAR_VFS
-    xfce_menu_monitor_set_vtable(NULL, NULL);
-#endif
-    
     if(desktop_menu->idle_id) {
         g_source_remove(desktop_menu->idle_id);
         desktop_menu->idle_id = 0;
@@ -613,21 +489,3 @@ xfce_desktop_menu_destroy_impl(XfceDesktopMenu *desktop_menu)
     g_free(desktop_menu->filename);
     g_free(desktop_menu);
 }
-
-G_MODULE_EXPORT gchar *
-g_module_check_init(GModule *module)
-{
-    gint w, h;
-    
-	/* libxfcemenu registers gobject types, so we can't be removed */
-	g_module_make_resident(module);
-	
-	xfce_menu_init("XFCE");
-	
-    gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &w, &h);
-    _xfce_desktop_menu_icon_size = w;
-    
-    _deskmenu_icon_theme = gtk_icon_theme_get_default();
-    
-    return NULL;
-}
diff --git a/src/xfce-desktop-menu.h b/src/xfce-desktop-menu.h
new file mode 100644
index 0000000..5c20168
--- /dev/null
+++ b/src/xfce-desktop-menu.h
@@ -0,0 +1,48 @@
+/*
+ *  xfdesktop - xfce4's desktop manager
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _XFCE_DESKTOP_MENU_H_
+#define _XFCE_DESKTOP_MENU_H_
+
+#include "xfce-desktop.h"
+
+#include <xfconf/xfconf.h>
+
+G_BEGIN_DECLS
+
+typedef struct _XfceDesktopMenu XfceDesktopMenu;
+
+XfceDesktopMenu *xfce_desktop_menu_new(const gchar *menu_file,
+                                            gboolean deferred);
+void xfce_desktop_menu_populate_menu(XfceDesktopMenu *desktop_menu,
+                                          GtkWidget *menu);
+GtkWidget *xfce_desktop_menu_get_widget(XfceDesktopMenu *desktop_menu);
+G_CONST_RETURN gchar *xfce_desktop_menu_get_menu_file(XfceDesktopMenu *desktop_menu);
+gboolean xfce_desktop_menu_need_update(XfceDesktopMenu *desktop_menu);
+void xfce_desktop_menu_start_autoregen(XfceDesktopMenu *desktop_menu,
+                                            guint delay);
+void xfce_desktop_menu_stop_autoregen(XfceDesktopMenu *desktop_menu);
+void xfce_desktop_menu_force_regen(XfceDesktopMenu *desktop_menu);
+void xfce_desktop_menu_set_show_icons(XfceDesktopMenu *desktop_menu,
+                                           gboolean show_icons);
+void xfce_desktop_menu_destroy(XfceDesktopMenu *desktop_menu);
+
+
+G_END_DECLS
+
+#endif
diff --git a/modules/menu/xfdesktop-app-menu-item.c b/src/xfdesktop-app-menu-item.c
similarity index 100%
rename from modules/menu/xfdesktop-app-menu-item.c
rename to src/xfdesktop-app-menu-item.c
diff --git a/modules/menu/xfdesktop-app-menu-item.h b/src/xfdesktop-app-menu-item.h
similarity index 100%
rename from modules/menu/xfdesktop-app-menu-item.h
rename to src/xfdesktop-app-menu-item.h



More information about the Xfce4-commits mailing list