summaryrefslogtreecommitdiff
path: root/Kernel/WindowComposer.cpp
blob: c33d236950a809d75520bc8a99093013d8829d82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "WindowComposer.h"
#include "Process.h"
#include <Widgets/Font.h>
#include <Widgets/FrameBuffer.h>
#include <Widgets/WindowManager.h>
#include <Widgets/RootWidget.h>
#include <Widgets/EventLoop.h>
#include <Widgets/MsgBox.h>

void WindowComposer_main()
{
    Font::initialize();
    FrameBuffer::initialize();
    EventLoop::initialize();
    WindowManager::initialize();
    AbstractScreen::initialize();

    auto info = current->get_display_info();

    dbgprintf("Screen is %ux%ux%ubpp\n", info.width, info.height, info.bpp);

    FrameBuffer framebuffer((dword*)info.framebuffer, info.width, info.height);
    RootWidget rw;
    EventLoop loop;

    WindowManager::the().setRootWidget(&rw);

    MsgBox(nullptr, "Serenity Operating System");

    dbgprintf("Entering WindowComposer main loop.\n");
    loop.exec();

    ASSERT_NOT_REACHED();
}