From 0338eb4f547f8eebe8c838c0794ec935db3cf0d8 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 29 Sep 2021 19:02:50 +0800 Subject: ... --- include/cru/osx/gui/Window.hpp | 55 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/cru/osx/gui/Window.hpp b/include/cru/osx/gui/Window.hpp index 14ad05ad..1e790a65 100644 --- a/include/cru/osx/gui/Window.hpp +++ b/include/cru/osx/gui/Window.hpp @@ -1,18 +1,67 @@ #pragma once #include "Resource.hpp" -#include "cru/platform/gui/Base.hpp" #include "cru/platform/gui/Window.hpp" +#include + namespace cru::platform::gui::osx { -class OsxWindow : public OsxGuiResource, public virtual INativeWindow { +namespace details { +class OsxWindowPrivate; +} + +class OsxUiApplication; + +class OsxWindow : public OsxGuiResource, public INativeWindow { + friend details::OsxWindowPrivate; + public: - OsxWindow(); + explicit OsxWindow(OsxUiApplication* ui_application); CRU_DELETE_COPY(OsxWindow) CRU_DELETE_MOVE(OsxWindow) ~OsxWindow() override; + public: + void Close() override; + + INativeWindow* GetParent() override; + + bool IsVisible() override; + void SetVisible(bool is_visible) override; + + Size GetClientSize() override; + void SetClientSize(const Size& size) override; + + Rect GetWindowRect() override; + void SetWindowRect(const Rect& rect) override; + + Point GetMousePosition() override; + + bool CaptureMouse() override; + bool ReleaseMouse() override; + + void SetCursor(std::shared_ptr cursor) override; + + void RequestRepaint() override; + + std::unique_ptr BeginPaint() override; + + IEvent* DestroyEvent() override; + IEvent* PaintEvent() override; + IEvent* ResizeEvent() override; + IEvent* FocusEvent() override; + IEvent* MouseEnterLeaveEvent() override; + IEvent* MouseMoveEvent() override; + IEvent* MouseDownEvent() override; + IEvent* MouseUpEvent() override; + IEvent* MouseWheelEvent() override; + IEvent* KeyDownEvent() override; + IEvent* KeyUpEvent() override; + + IInputMethodContext* GetInputMethodContext() override; + private: + std::unique_ptr p_; }; } // namespace cru::platform::gui::osx -- cgit v1.2.3