summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSWindowFrame.h
blob: 726ebc5764a0e9b42ce8803dd8b6a3f010dc838b (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
#pragma once

#include <AK/Badge.h>
#include <AK/NonnullOwnPtrVector.h>

class Painter;
class Rect;
class WSButton;
class WSMouseEvent;
class WSWindow;

class WSWindowFrame {
public:
    WSWindowFrame(WSWindow&);
    ~WSWindowFrame();

    Rect rect() const;
    void paint(Painter&);
    void on_mouse_event(const WSMouseEvent&);
    void notify_window_rect_changed(const Rect& old_rect, const Rect& new_rect);
    void invalidate_title_bar();

    Rect title_bar_rect() const;
    Rect title_bar_icon_rect() const;
    Rect title_bar_text_rect() const;

    void did_set_maximized(Badge<WSWindow>, bool);

private:
    WSWindow& m_window;
    NonnullOwnPtrVector<WSButton> m_buttons;
    WSButton* m_maximize_button { nullptr };
};