How do you parse the XDG/gnome/kde menu/desktop item structure programmatically (using c)



Hi All, 

I would like to parse the menu structure for Gnome Panels (the standard Gnome Desktop application launcher) using c/c++ function calls. That is, I'd like a list of what the base menus and submenus for Gnome panels are install in a given machine. I would like to do with using fairly simple c/c++ function calls (with no shelling out hopefully). 

I understand that these menus are in the standard xdg format. 
I understand that this menu structure is stored in xml files such as:

    /home/user/.config/menus/applications.menu

I've looked here: http://www.freedesktop.org/wiki/Specifications/menu-spec?action=show&redirect=Standards%2Fmenu-spec 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 simple 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: http://library.gnome.org/admin/system-admin-guide/stable/menustructure-13.html.en for more notes on these structures. None of this has so-far given me a concrete idea of how to determine the menu structures using a c/c++ program. 

The actual gnome menu xml files seem to be rather hairy things - they don't seem to show the menu structure but to give an XML-coded description of *all the changes* that the menus have gone through since installation (from which one could indeed deduce the final result but not in a straight-forward fashion). I assume the gnome panels applets 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 code seem to exist elsewhere or is burried deep in the Nautilus code. 

Thanks much in advance, sorry if this betrays my ignorance of Gnome structures, etc. 

HJS



      



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