type=menubar layouts

The contents of a layouts of type=menubar specify the methods invoked by menu bar layout manager's generate():

<layout type="menubar" id="mainmenubar">
  <append_menus>
    <name>mainmenu</name>
  </append_menus>
</layout>

<factory type="menubar" id="mainmenu">

  <!-- ... -->

</factory>

// ...

main_window->get_menubarlayoutmanager()
    ->generate("mainmenubar", generator, elements);

Using a main window's get_menubarlayoutmanager() and invoking its generate() executes the instructions from the layouts of type=menubar. These layouts contain the following elements:

append_menus, insert_menus append_right_menus, and insert_right_menus

This is equivalent to invoking the corresponding x::w::menubarlayoutmanager method to create a new x::w::menubarfactory. The name specifies the id of a factory that generates the contents of the resulting x::w::menubarfactory. The position element specifies the insertion position parameter (for insert_menus and insert_right_menus).

remove_menu and remove_right_menus

For completeness' sake, this is equivalent to invoking the corresponding x::w::menubarlayoutmanager method to remove a menu from the menu bar.

<remove_menu>
  <position>1</position>
</remove_menu>