The Xen HTML API allows you to provide resource packs to share content between widgets. This is to help reduce the download size of widgets, and also to access a variety of iconography installed by default.
You can use resource packs via a new URI scheme:
<img src="xui://resource/default/media/play.svg" />
This will load an image with its source set to a
media icon from the
default resource pack. Anywhere a URL can be referenced, you can use an resource pack, including in CSS.
As shown above, the
xui:// URI scheme is used to load content from an resource pack. The format is broken down as follows:
my-great-packwould load from the
/Library/Application Support/Widgets/Resource Packs
defaultpack has a subfolder named
media, which contains a file named
defaultpack will be loaded instead
You are not limited by the subfolder names used inside the
default pack. For example:
This is perfectly valid, so long as the
testing resource pack has a subfolder named
default resource pack contains a number of icons available for use, without needing to include them inside your widget. These are styled in the vein of iOS, and are provided as SVG to allow scaling without quality loss.
Available icons, grouped by subfolder:
[0-47].svg(e.g., all weather icons that relate to a weather condition code)
[0-100].svg(an image is provided for each battery level 'step', e.g. 10.svg, 20.svg, ...)