Index: 04_common/index.html =================================================================== --- 04_common/index.html (revision 32246) +++ 04_common/index.html (revision 32247) @@ -109,3 +109,143 @@ the configured presets, these properties of the current grid can be changed any time, using the SetValue() action or using the menu. + + + +

5.4.5.1. Menu files, patches and sources

+

+The menu system is loaded and merged from multiple menu files and is dynamic +(can be changed while pcb-rnd is running). There is a base menu file +(file name is partially configured by conf node rc/menu_file), typically +/usr/share/pcb-menu-default.lht. This is file is loaded first, with priority 0. +Then pcb-rnd loads further menu files and menu file patches, for feature plugins, +scripts or user addons at higher priority. +

+All menu files and menu patches are kept in memory. Upon loading, +unloading or modifying any of these in-memory menu images, pcb-rnd will +merge them into the final menu tree, which is what the GUI menu layout is +modified to. +

+The following menu file/patch sources are supported: +

+ +
source usual prio description +
base 0 factory menu file, normally /usr/share/pcb-menu-default.lht +
plugins (static) 100..199 menu files embedded in feature plugins (e.g. to create import menus per format) +
user 300..400 menu files/patches loaded upon user request (conf node: rc/menu_patches) +
action (scripts) 500 using the CreateMenu() action +
plugins (dynamic) 500 e.g. route style or layer menus that are generated from board data +
+ +

5.4.5.2. Menu files vs. menu patches

+

+Menu files describe the menu tree, or a part of the menu tree, in its final +form. The base of the menu system, at priority 0, must be a menu file. When +a menu file is used to patch an existing in-memory menu image (at priority +higher than 0), it can overwrite existing parts of the image or it can +append to existing menus and submenus. But it can not remove submenus or +modify existing submenus without fully overwriting them. The root node +of a menu file is ha:rnd-menu-v1. +

+A menu patch file contains an ordered list of instructions on how to +make modifications to the current in-memory menu image. The menu patch +file is a lihata document as follos: +

+ha:rnd-menu-patch-v1 {
+	prio=456
+	li:patch {
+		...instructions (see below)...
+	}
+}
+
+

+The priority value is optional; when specified, it is used to position the +patch in the order of merging. Instructions are executed in the order they +are specified in the file. +

+An instruction can be one of these: +

+