Removed skin lookup feature from OffscreenSurface::loadImage

Instead, make the caller perform the lookup. This simplifies the
interface of loadImage and it removes the dependency from
OffscreenSurface on SurfaceCollection.
Fixed compile error on platforms where ENABLE_CPUFREQ is defined
Removed static version of SurfaceCollection::getSkinFilePath

There were no external callers anymore.
Have Font::write return the width of the drawn text

This avoids having to do separate getTextWidth calls in several places.

More getTextWidth calls could be saved by splitting the rendering of
the font to an off-screen buffer from the final composition onto the
destination surface: the routines that draw text inside a box have to
compute the width before they can draw the box and currently the box
has to be drawn before the text.
Store "bgmain" in the GMenu2X object instead of in SurfaceCollection

Since this surface is created by initBG instead of loaded from skin
search paths, it didn't really fit in SurfaceCollection. After removing
it, one of SurfaceCollection's methods could be removed as well.
Store Menu's Monitors in unique_ptrs

This results in a small code reduction and some ease of mind.
Don't use (void) for empty argument list

This is necessary in C, but unusual in C++.
Don't use string::compare if there are better alternatives

When comparing full strings, operator== will do nicely.
When comparing the first char, "s[0] == c" is more efficient if we know
the string cannot be empty.
Minor optimizations in Menu

Use emplace_back when a new string is put into a vector.
Removed unused variables.
When searching section names, compare C++ string to C string, so we
don't need to construct a C++ string for the second string just for
the search.
In GMenu2X::drawButton, don't build a rectangle if we only need width
Simplify code to reload section icons when skin changes
Removed GMenu2X::drawButton variant

This was only called form ButtonBox, so I moved the code there.

I still think a paint method shouldn't be repositioning widgets, but
that's something for a later cleanup.
Changed icon lookup in GMenu2X::drawButton(Right)

Look up the icon with the "skin:" prefix to be consistent with how
other lookups of the same icons are performed. Also don't perform
repeated lookups.
Handle labelless icon positioning in GMenu2X::drawButton(Right)

Instead of correcting the returned coordinate with "- 10" externally,
omit the white space inside the methods.

Note that Font::getTextWidth, which was used until recently, considers
an empty string to have width 1, so 3 + getTextWidth("") + 6 == 10.

There is a difference in how buttons that have neither a label nor an
icon are positioned in the new code, but that is a situation that
should not occur in practice. Plus I'd argue that the new behavior is
actually better in that case.
Simplify bottom bar button drawing in Selector

Put the drawButton calls left-to-right.
Avoid duplicate code.

The order was changed: "Select" is now always first, to be consistent
with other dialogs.
Fix crash in Selector::exec when the initial directory doesn't exist

If the directory scanned by Selector::exec's call to FileLister::browse
doesn't exist, the FileLister object is left with 0 directories and 0
files. Selector::exec first asked whether element 0 was a file, then
after finding out it was a file, tried to access its name, at which
point it crashed in FileLister::operator[].

This was due to a bad boundary in FileLister::isFile, which returned
true beyond the end of the list.
Fix dynamic allocation of IconButton instances

Previously, IconButton instances to be added to button boxes were
allocated with new, but never freed with delete.

unique_ptr makes sure the buttons will be freed along with the button
box that owns them, or when code calls ButtonBox::clear.

The destructor of ButtonBox has been made redundant by this change, so
it's gone.