ladybird/Widgets/WindowManager.h
2018-10-12 01:20:06 +02:00

36 lines
716 B
C++

#pragma once
#include "Object.h"
#include "Rect.h"
#include <AK/HashTable.h>
class MouseEvent;
class Widget;
class Window;
class WindowManager : public Object {
public:
static WindowManager& the();
void addWindow(Window&);
void paintWindowFrames();
void notifyTitleChanged(Window&);
void notifyRectChanged(Window&, const Rect& oldRect, const Rect& newRect);
Widget* rootWidget() { return m_rootWidget; }
void setRootWidget(Widget*);
private:
WindowManager();
~WindowManager();
void processMouseEvent(MouseEvent&);
virtual void event(Event&) override;
void paintWindowFrame(Window&);
HashTable<Window*> m_windows;
Widget* m_rootWidget { nullptr };
};