title: How do you parse the XDG/gnome/kde menu/desktop item structure in c++?
body: <p>I would like to parse the menu structure for Gnome Panels (the standard Gnome Desktop application launcher) and it's KDE equivalent using c/c++ function calls. That is, I'd like a list of what the base menu categories and submenu are installed in a given machine. I would like to do with using fairly simple c/c++ function calls (with NO shelling out <em>please</em>). </p>
  
  <p>I understand that these menus are in the standard xdg format. 
  I understand that this menu structure is stored in xml files such as:</p>
  
  <pre><code>/home/user/.config/menus/applications.menu
  </code></pre>
  
  <p>I've looked here: <a href="http://www.freedesktop.org/wiki/Specifications/menu-spec?action=show&amp;redirect=Standards%2Fmenu-spec" rel="nofollow noreferrer">http://www.freedesktop.org/wiki/Specifications/menu-spec?action=show&amp;redirect=Standards%2Fmenu-spec</a> but all they offer is the standard and some shell files to insert item entries (I don't want shell scripts, I don't want installation, I definitely don't want to create a c-library from the XDG specification. I want to find the existing menu structure). I've looked here: <a href="http://library.gnome.org/admin/system-admin-guide/stable/menustructure-13.html.en" rel="nofollow noreferrer">http://library.gnome.org/admin/system-admin-guide/stable/menustructure-13.html.en</a> for more notes on these structures. None of this gives me a good idea of how determine the menu structures using a c/c++ program. </p>
  
  <p>The actual gnome menu structures seem to be a horrifically hairy things - they don't seem to show the menu structure but to give an XML-coded description of <em>all the changes</em> that the menus have gone through since installation. I assume gnome panels parses these file so there's a function buried somewhere to do this but I've yet to find where that function is after scanning library.gnome.org for a couple of days. I've scanned the Nautilus source code as well but Panels seem to exist elsewhere or are burried well. </p>
  
  <p>Thanks in advance</p>