Bug 750901 - Elm to mc migration work - metro related changes to Windows widget src to support building metro winrt bits (nsWidgetFactory, nsWindowGfx, nsToolkit, WinUtils). Also landing nsIWinMetroUtils.idl. r=bbondy

This commit is contained in:
Jim Mathies
2012-11-02 06:54:44 -05:00
parent a28a0a7bee
commit 1af6ce1ff7
19 changed files with 370 additions and 94 deletions

View File

@@ -27,19 +27,41 @@
* method for the nsAppShell class.
*/
static nsAppShell *sAppShell;
#include "nsXULAppAPI.h"
#if defined(MOZ_METRO) && defined(XP_WIN)
#include "winrt/MetroAppShell.h"
#endif
static nsIAppShell *sAppShell;
static nsresult
nsAppShellInit()
{
NS_ASSERTION(!sAppShell, "already initialized");
#if !defined(MOZ_METRO) || !defined(XP_WIN)
sAppShell = new nsAppShell();
#else
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
sAppShell = new MetroAppShell();
} else {
sAppShell = new nsAppShell();
}
#endif
if (!sAppShell)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(sAppShell);
nsresult rv = sAppShell->Init();
nsresult rv;
#if !defined(MOZ_METRO) || !defined(XP_WIN)
rv = static_cast<nsAppShell*>(sAppShell)->Init();
#else
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
rv = static_cast<MetroAppShell*>(sAppShell)->Init();
} else {
rv = static_cast<nsAppShell*>(sAppShell)->Init();
}
#endif
if (NS_FAILED(rv)) {
NS_RELEASE(sAppShell);
return rv;