Wine theming (follow up)

Reece Dunn msclrhd at
Wed Nov 5 06:50:55 CST 2008

2008/11/4 Roderick Colenbrander <thunderbird2k at>:
> Hi,
> The way to go for Wine theming is to use Windows XP themes. Unfortunately the file format itself is not documented. Based on Wine its uxtheme code (BTW our uxtheme is quite complete) and an analysis of some 'free' XP themes like 'ClearLook' I was able to write my own theme template.

The format has completely changed with Vista. It is similar in that it
is a DLL, but all the theme metrics and stuff are in unintelligible
binary blocks. Whereas it is possible to read the XP configurations,
it is not possible in Vista.

The Vista theming format (from the Platform SDK) adds support for
theming Menus, so this would allow the menus to better fit into the
native platform (e.g. Mac OSX). Since the format is largely unknown, I
doubt Wine will support it.

> The theme file I made only consists of a 'SysMetrics' section which contains the 'classic' color names which can also be adjusted from the Control Panel\\Colors registry location. The difference is that in XP Microsoft cleaned up the names, so some of the names have changed. The theme is compiled using mingw because right now winecfg seems to need a real 'MZ' header.

A DLL requires a proper image header, irrespective of whether it
actually contains any code.

> A lot of work is needed especially in comctl32 and also in uxtheme its drawing code to optimize the drawing performance and to properly render themes. For this purpose you should use some free native XP themes and try them to render properly in Wine. The uxtheme drawing code needs to handle margins, locations and positions properly. Right now in case of a button comctl32 is making assumptions about text locations and I don't think that belongs there.

This is true.

There are still some controls (scrollbar and static come to mind) that
do not have theiming support yet.

The button theming support only supports normal and disabled states.
It also does not update properly when the button changes state (e.g.
when it gains the focus) - it reverts back to the non-themed rendering
(this requires tests for the user32 button control to validate that a
WM_PAINT message is sent whenever the state changes; I have the patch
to change the code, but not the tests).

The button control is still a work in progress w.r.t. theming, so
don't expect much at this point.

I am using the following themes for testing:
  Zune --
  Human --
  ClearLooks --

In addition to this, StyleXP ( has
a set of themes that are useful for testing the current capabilities
of uxtheme and comctl32 (some of the themes don't render correctly,
and some are slow).

Also, the theme switching does not quite work, w.r.t. updating winecfg
to reflect the new theme; this may be a winecfg problem, though, not
necessarily a uxtheme problem.

- Reece

More information about the wine-devel mailing list