Remove last remaining uses of <background> elements in layouts, and print warning messages on encountering deprecated elements.

This commit is contained in:
Vas Crabb 2020-09-10 05:23:47 +10:00
parent 27d1ceacbf
commit b68c48f5f8
3 changed files with 35 additions and 411 deletions

View File

@ -97,7 +97,6 @@ class LayoutChecker(Minifyer):
VARPATTERN = re.compile('^.*~[0-9A-Za-z_]+~.*$')
FLOATCHARS = re.compile('^.*[.eE].*$')
SHAPES = frozenset(('disk', 'dotmatrix', 'dotmatrix5dot', 'dotmatrixdot', 'led14seg', 'led14segsc', 'led16seg', 'led16segsc', 'led7seg', 'led8seg_gts1', 'rect'))
OBJECTS = frozenset(('backdrop', ))
ORIENTATIONS = frozenset((0, 90, 180, 270))
YESNO = frozenset(('yes', 'no'))
BLENDMODES = frozenset(('none', 'alpha', 'multiply', 'add'))
@ -452,12 +451,11 @@ class LayoutChecker(Minifyer):
self.handlers.pop()
def groupViewStartHandler(self, name, attrs):
if (name in self.OBJECTS) or ('element' == name):
refattr = 'ref' if 'element' == name else 'element'
if refattr not in attrs:
self.handleError('Element %s missing attribute %s' % (name, refattr))
elif attrs[refattr] not in self.referenced_elements:
self.referenced_elements[attrs[refattr]] = self.formatLocation()
if 'element' == name:
if 'ref' not in attrs:
self.handleError('Element %s missing attribute ref' % (name, ))
elif attrs['ref'] not in self.referenced_elements:
self.referenced_elements[attrs['ref']] = self.formatLocation()
if ('blend' in attrs) and (attrs['blend'] not in self.BLENDMODES) and not self.VARPATTERN.match(attrs['blend']):
self.handleError('Element %s attribute blend "%s" is unsupported' % (name, attrs['blend']))
if 'inputtag' in attrs:

View File

@ -3305,11 +3305,6 @@ void layout_view::add_items(
else
env.set_repeat_parameter(*itemnode, init);
}
else if (!strcmp(itemnode->get_name(), "backdrop"))
{
layers.backdrops.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "screen"))
{
layers.screens.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
@ -3319,23 +3314,38 @@ void layout_view::add_items(
layers.screens.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "backdrop"))
{
if (layers.backdrops.empty())
osd_printf_warning("Warning: layout view '%s' contains deprecated backdrop element\n", name());
layers.backdrops.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "overlay"))
{
if (layers.overlays.empty())
osd_printf_warning("Warning: layout view '%s' contains deprecated overlay element\n", name());
layers.overlays.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "bezel"))
{
if (layers.bezels.empty())
osd_printf_warning("Warning: layout view '%s' contains deprecated bezel element\n", name());
layers.bezels.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "cpanel"))
{
if (layers.cpanels.empty())
osd_printf_warning("Warning: layout view '%s' contains deprecated cpanel element\n", name());
layers.cpanels.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}
else if (!strcmp(itemnode->get_name(), "marquee"))
{
if (layers.marquees.empty())
osd_printf_warning("Warning: layout view '%s' contains deprecated marquee element\n", name());
layers.marquees.emplace_back(env, *itemnode, elemmap, orientation, trans, color);
m_has_art = true;
}

View File

@ -5,409 +5,25 @@ license:CC0
<mamelayout version="2">
<element name="grid"><rect><color red="0.0" green="0.0" blue="0.0" alpha="0.0"/></rect></element>
<element name="grid" />
<view name="Default Grid">
<backdrop element="grid" inputtag="GRID.0" inputmask="0x01" >
<bounds x="0" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x01" >
<bounds x="16" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x01" >
<bounds x="32" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x01" >
<bounds x="48" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x01" >
<bounds x="64" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x01" >
<bounds x="80" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x01" >
<bounds x="96" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x01" >
<bounds x="112" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x01" >
<bounds x="128" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x01" >
<bounds x="144" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x01" >
<bounds x="160" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x01" >
<bounds x="176" y="0" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x01" >
<bounds x="192" y="0" width="8" height="16" />
</backdrop>
<repeat count="10">
<param name="mask" start="0x01" lshift="1" />
<param name="y" start="0" increment="16" />
<repeat count="12">
<param name="port" start="0" increment="1" />
<param name="x" start="0" increment="16" />
<element ref="grid" inputtag="GRID.~port~" inputmask="~mask~">
<bounds x="~x~" y="~y~" width="16" height="16" />
</element>
</repeat>
<element ref="grid" inputtag="GRID.12" inputmask="~mask~" >
<bounds x="192" y="~y~" width="8" height="16" />
</element>
</repeat>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x02" >
<bounds x="0" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x02" >
<bounds x="16" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x02" >
<bounds x="32" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x02" >
<bounds x="48" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x02" >
<bounds x="64" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x02" >
<bounds x="80" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x02" >
<bounds x="96" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x02" >
<bounds x="112" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x02" >
<bounds x="128" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x02" >
<bounds x="144" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x02" >
<bounds x="160" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x02" >
<bounds x="176" y="16" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x02" >
<bounds x="192" y="16" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x04" >
<bounds x="0" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x04" >
<bounds x="16" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x04" >
<bounds x="32" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x04" >
<bounds x="48" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x04" >
<bounds x="64" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x04" >
<bounds x="80" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x04" >
<bounds x="96" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x04" >
<bounds x="112" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x04" >
<bounds x="128" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x04" >
<bounds x="144" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x04" >
<bounds x="160" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x04" >
<bounds x="176" y="32" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x04" >
<bounds x="192" y="32" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x08" >
<bounds x="0" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x08" >
<bounds x="16" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x08" >
<bounds x="32" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x08" >
<bounds x="48" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x08" >
<bounds x="64" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x08" >
<bounds x="80" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x08" >
<bounds x="96" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x08" >
<bounds x="112" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x08" >
<bounds x="128" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x08" >
<bounds x="144" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x08" >
<bounds x="160" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x08" >
<bounds x="176" y="48" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x08" >
<bounds x="192" y="48" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x10" >
<bounds x="0" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x10" >
<bounds x="16" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x10" >
<bounds x="32" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x10" >
<bounds x="48" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x10" >
<bounds x="64" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x10" >
<bounds x="80" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x10" >
<bounds x="96" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x10" >
<bounds x="112" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x10" >
<bounds x="128" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x10" >
<bounds x="144" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x10" >
<bounds x="160" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x10" >
<bounds x="176" y="64" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x10" >
<bounds x="192" y="64" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x20" >
<bounds x="0" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x20" >
<bounds x="16" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x20" >
<bounds x="32" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x20" >
<bounds x="48" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x20" >
<bounds x="64" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x20" >
<bounds x="80" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x20" >
<bounds x="96" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x20" >
<bounds x="112" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x20" >
<bounds x="128" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x20" >
<bounds x="144" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x20" >
<bounds x="160" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x20" >
<bounds x="176" y="80" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x20" >
<bounds x="192" y="80" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x40" >
<bounds x="0" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x40" >
<bounds x="16" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x40" >
<bounds x="32" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x40" >
<bounds x="48" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x40" >
<bounds x="64" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x40" >
<bounds x="80" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x40" >
<bounds x="96" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x40" >
<bounds x="112" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x40" >
<bounds x="128" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x40" >
<bounds x="144" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x40" >
<bounds x="160" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x40" >
<bounds x="176" y="96" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x40" >
<bounds x="192" y="96" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x80" >
<bounds x="0" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x80" >
<bounds x="16" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x80" >
<bounds x="32" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x80" >
<bounds x="48" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x80" >
<bounds x="64" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x80" >
<bounds x="80" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x80" >
<bounds x="96" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x80" >
<bounds x="112" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x80" >
<bounds x="128" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x80" >
<bounds x="144" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x80" >
<bounds x="160" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x80" >
<bounds x="176" y="112" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x80" >
<bounds x="192" y="112" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x100" >
<bounds x="0" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x100" >
<bounds x="16" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x100" >
<bounds x="32" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x100" >
<bounds x="48" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x100" >
<bounds x="64" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x100" >
<bounds x="80" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x100" >
<bounds x="96" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x100" >
<bounds x="112" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x100" >
<bounds x="128" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x100" >
<bounds x="144" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x100" >
<bounds x="160" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x100" >
<bounds x="176" y="128" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x100" >
<bounds x="192" y="128" width="8" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.0" inputmask="0x200" >
<bounds x="0" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.1" inputmask="0x200" >
<bounds x="16" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.2" inputmask="0x200" >
<bounds x="32" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.3" inputmask="0x200" >
<bounds x="48" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.4" inputmask="0x200" >
<bounds x="64" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.5" inputmask="0x200" >
<bounds x="80" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.6" inputmask="0x200" >
<bounds x="96" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.7" inputmask="0x200" >
<bounds x="112" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.8" inputmask="0x200" >
<bounds x="128" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.9" inputmask="0x200" >
<bounds x="144" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.10" inputmask="0x200" >
<bounds x="160" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.11" inputmask="0x200" >
<bounds x="176" y="144" width="16" height="16" />
</backdrop>
<backdrop element="grid" inputtag="GRID.12" inputmask="0x200" >
<bounds x="192" y="144" width="8" height="16" />
</backdrop>
<screen index="0">
<bounds left="0" top="0" right="200" bottom="160" />
</screen>