#include "Win32UIInterface.h"

#include <Windows.h>

Win32UIInterface::Win32UIInterface(DesktopManager* desktopManager, std::unique_ptr<FontsManager> fontsManager, bool useHardware)
    :   AbstractUIInterface(desktopManager, std::move(fontsManager), useHardware),
     mWindowInterface(std::make_unique<Win32WindowInterface>())
{

}

void Win32UIInterface::initialize()
{

}

void Win32UIInterface::loop()
{
    // Run the message loop.
    MSG msg = { };
    while (::GetMessage(&msg, NULL, 0, 0))
    {
        ::TranslateMessage(&msg);
        ::DispatchMessage(&msg);
    }
}

void Win32UIInterface::shutDown()
{

}

void Win32UIInterface::showWindow(mt::Window* window)
{
    mWindowInterface->Show(window);
}

void Win32UIInterface::addWindow(mt::Window* window)
{
    mWindowInterface->Add(window, mDesktopManager);
}