mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "GObject.h"
|
|
#include <SharedGraphics/Rect.h>
|
|
#include <SharedGraphics/GraphicsBitmap.h>
|
|
#include <AK/AKString.h>
|
|
|
|
class GWindow final : public GObject {
|
|
public:
|
|
explicit GWindow(int window_id);
|
|
virtual ~GWindow() override;
|
|
|
|
int window_id() const { return m_window_id; }
|
|
|
|
String title() const { return m_title; }
|
|
void set_title(String&&);
|
|
|
|
int x() const { return m_rect.x(); }
|
|
int y() const { return m_rect.y(); }
|
|
int width() const { return m_rect.width(); }
|
|
int height() const { return m_rect.height(); }
|
|
|
|
const Rect& rect() const { return m_rect; }
|
|
void set_rect(const Rect&);
|
|
void set_rect_without_repaint(const Rect& rect) { m_rect = rect; }
|
|
|
|
Point position() const { return m_rect.location(); }
|
|
void set_position_without_repaint(const Point& position) { set_rect_without_repaint({ position.x(), position.y(), width(), height() }); }
|
|
|
|
virtual void event(GEvent&) override;
|
|
|
|
bool is_being_dragged() const { return m_is_being_dragged; }
|
|
void set_is_being_dragged(bool b) { m_is_being_dragged = b; }
|
|
|
|
bool is_visible() const;
|
|
|
|
void close();
|
|
|
|
GraphicsBitmap* backing() { return m_backing.ptr(); }
|
|
|
|
private:
|
|
String m_title;
|
|
Rect m_rect;
|
|
bool m_is_being_dragged { false };
|
|
|
|
RetainPtr<GraphicsBitmap> m_backing;
|
|
int m_window_id { -1 };
|
|
};
|
|
|