Plugin System/API/UI Widgets

Glossary of Terms
A widget id (widget identifier) is an as-yet-unspecified string that can be used to identify a specific instance of a widget. Perhaps a UUID or similar.

An attribute is a property of the widget, such as text label, color, size, or current value. Each widget type has a specific, pre-defined list of attributes, depending on the characteristics of that widget type.

General Methods
The following methods (actions that can be performed) are shared among all UI widget types.


 * List Attributes. Accepts a widget id (alternatively, the name of a widget type). Returns an array of names of attributes the widget supports.
 * Get Attributes. Accepts a widget identifier and an array of names of attributes to retrieve values for. Returns an associative array of attribute names and their current values.
 * Set Attributes. Accepts a widget id and an associative array of attribute names and the values they should be set to. Return value (if any) to be decided.
 * Get Children. Accepts a widget id of the parent object. Returns an array of widget ids of the given widget's children (contained widgets, or list items). If the widget has no children, but the widget type supports children, returns an empty array. If the widget type can never have children, returns null.
 * Add Child(ren). Accepts a widget id of the parent, and either a single widget id of the child or an array of the widget ids of multiple children. This method can only be used for widget types that support children. Returns an error and does not add any children if the parent widget's type does not support children, or if any of the children are of an incompatible type (e.g. trying to add a button as the child of a menu).
 * Remove Child(ren). Accepts the same arguments as when adding children. Return an error and does not remove any children if any of the given child widgets are not actually children of the parent.

Widget Types
To be written: list of possible widget types, their attributes, and their allowed child types.