## parser parser — A parser of in-memory GTK menu trees |

## Stability Level

Unstable, unless otherwise indicated

## Functions

DbusmenuMenuitem * | dbusmenu_gtk_parse_menu_structure ()
DbusmenuMenuitem * | dbusmenu_gtk_parse_get_cached_item ()

## Includes

    #include <libdbusmenu-gtk/parser.h>

## Description

The parser will take a GTK menu tree and attach it to a Dbusmenu menu tree. Along with setting up all the signals for updates and destruction. The returned item would be the root item of the given tree.

## Functions

### dbusmenu_gtk_parse_menu_structure ()

    DbusmenuMenuitem *
    dbusmenu_gtk_parse_menu_structure (GtkWidget *widget);

Goes through the GTK structures and turns them into the appropraite Dbusmenu structures along with setting up all the relationships between the objects. It also stores the dbusmenu items as a cache on the GTK items so that they'll be reused if necissary.

#### Parameters

widget | A GtkMenuItem or GtkMenuShell to turn into a DbusmenuMenuitem |

#### Returns

A dbusmenu item representing the menu structure.

[transfer full]

### dbusmenu_gtk_parse_get_cached_item ()

    DbusmenuMenuitem *
    dbusmenu_gtk_parse_get_cached_item (GtkWidget *widget);

The Dbusmenu GTK parser adds cached items on the various menu items throughout the tree. Sometimes it can be useful to get that cached item to use directly. This function will retrieve it for you.

#### Parameters

widget | A GtkMenuItem that may have a cached DbusmenuMenuitem from the parser |

#### Returns

A pointer to the cached item or NULL if it isn't there.

[transfer none]