theme: Add MetaStyleInfo for wrapping frame style context

Our current use of style contexts is fairly limited - we don't
use them for much more than picking up some color information.
We will soon start to make more elaborate use of GTK style
information, but a single context will no longer be enough
to draw a frame then.
To prepare for this, add a simple ref-counted type to wrap
style information.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Build a StyleContext hierarchy that matches GTK+'s CSD

In order to pick up all theme information from GTK+, a single style
context is not enough; a style hierarchy that closely matches the widget
hierarchy by GTK+'s client-side decorations will allow this soon.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
frames: Use title style to set up title layout

Sounds obvious, doesn't it?

After this change when titlebar-uses-system-font is set, the "system
font" used will not be a generic one, but match what GTK+ uses in
client-side decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Add method to adjust styles for frame state

GTK+ expresses the window state as style classes and widget state for
client-side decorations. Add a helper method to translate our own frame
state to the corresponding changes to the style context hierarchy.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Add function to fill geometry information from GTK+ theme

We want to eventually pick up all theme information from GTK+ instead
of our own theme format; to prepare for this, add another helper method
to fill in geometry information from the GTK+ theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Use style information from GTK+

We now have everything in place to pick up geometry and drawing
information from GTK+ rather than the metacity theme, so do just
that; the metacity theme is now only used for some constants
(title_scale, hide_buttons, ...), which we will replace soon.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
Properly update on GTK+ theme changes

With geometry information picked up from GTK+, we need to queue a
resize on GTK+ theme changes to correctly update to the new geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
frames: Adapt frame mask/bounds

The frame shape is relevant in three places:
 - the window decoration we draw
 - the frame mask (used for the shape region)
 - the frame bounds (used for clipping)

All three should match, so make sure to use the same GTK+ method for
the first two, and bring the (non-antialiased) third closer to the
other two by removing an obscure modifier from the corner radius.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Scale whitespace from theme with title_scale factor

GTK+ doesn't deal with different frame types for its client-side
decorations - it just treats dialogs the same as normal windows
and ignores the odder frame types like UTILITY and MENU. That's
fine as those have largely gone out of fashion anyway, but it's a
different case for the WM - we still have to support them somehow.
For now, just apply the existing title_scale factor to the geometry
information picked up from the theme in addition to the title font.
If it turns out that there's demand for something more sophisticated,
we can still consider adding wm-only style information to the GTK+
theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Disable support for fringe buttons

Few themes ever had support for those in the first place, and even
less supported them properly; in particular support in the default
theme has been broken for a while now.
With this in mind (and considering that not even the tweak tool exposes
any UI to configure them), let's (try to) remove support altogether - the
corresponding rects are still kept around, so it's easy to add back in
case we reconsider (and get the necessary artwork).

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Don't load metacity themes

All geometry/drawing information is now picked up from the GTK+ theme,
so replace the remaining bits (hide_buttons + title_scale) with
hardcoded values from the default Adwaita theme and stop loading
the metacity theme altogether.
If there is a need to theme those constants again in the future,
we should make them available from GTK+ where they are available
for client-side decorations as well. They certainly don't justify
maintaining support for a complex theme format.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Use a singleton theme

Different themes don't make sense when we are always using the current
GTK+ theme for everything, so adapt the MetaTheme API to use a singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
Remove all support for the metacity format

Rest in peace you magnificent format, love-child of arcane X11 drawing
API and markup craze, you will not be missed.
We do remember however the bravery of a many men and women, who fearlessly
descended into the guts of your intrinsics and turned ugliness into beauty;
their work will still be spoken of when you will long have been forgotten.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
frames: Rename layout to text_layout

... to differentiate PangoLayout from MetaFrameLayout.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Remove MetaFrameResize

Really, styling windows differently based on how they can be resized
is over the top ...

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Remove MetaFrameStyle/MetaFrameStyleSet

MetaFrameStyle now only holds a MetaFrameLayout, so we can cut out
the middle man and use the layout directly. And as we are already
using a single style/layout per frame set and handle frame state
and focus by setting appropriate style flags, MetaFrameStyleSet
is pointless too - just store one MetaFrameLayout per frame type
directly in the theme.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
theme: Move the layout we save closer to GTK+'s model

With support for the old metacity theme format gone, there's no
reason to keep storing theme information in terms of the old theme
properties. Just store the padding/border information for each
element directly.

https://bugzilla.gnome.org/show_bug.cgi?id=741917