15#include "AUI/Common/AString.h"
17#include "AUI/Common/AObject.h"
18#include "AUI/Common/ASignal.h"
20#include "AUI/Platform/AWindowBase.h"
21#include "AUI/Thread/IEventLoop.h"
22#include "AUI/Util/AMetric.h"
23#include "AWindowNativePtr.h"
24#include <AUI/Enum/WindowStyle.h>
25#include <AUI/Enum/AScreenOrientation.h>
30#elif AUI_PLATFORM_ANDROID
32#elif AUI_PLATFORM_APPLE
50 friend struct painter;
53 windowNativePreInit(name,
width,
height, parent, ws);
73 static bool isRedrawWillBeEfficient();
75 void setIcon(
const AImage& image);
82 void setWindowStyle(WindowStyle ws);
92 bool isMinimized()
const;
102 bool isMaximized()
const;
109 void flagRedraw()
override;
123 bool isClosed() const noexcept;
126 HWND getNativeHandle() {
return mHandle; }
127#elif AUI_PLATFORM_ANDROID
128 jobject getNativeHandle() {
return mHandle; }
129#elif AUI_PLATFORM_APPLE
131 AWindowNativePtr getNativeHandle() {
return mHandle; }
134 auto nativeHandle()
const {
138 const AString& getWindowTitle()
const
143 glm::ivec2 getWindowPosition()
const;
145 void setPosition(glm::ivec2 position)
override;
146 void setSize(glm::ivec2 size)
override;
147 void setGeometry(
int x,
int y,
int width,
int height)
override;
149#if AUI_PLATFORM_LINUX
150 void applyGeometryToChildren()
override;
153 void onFocusAcquired()
override;
154 void onFocusLost()
override;
156 void onKeyDown(AInput::Key key)
override;
157 void onKeyRepeat(AInput::Key key)
override;
159 void setFocusNextViewOnTab(
bool value) {
160 mFocusNextViewOnTab = value;
182 [[nodiscard]] glm::ivec2 mapPositionTo(
const glm::ivec2& position,
_<AWindow> other);
189 [[nodiscard]] glm::ivec2 unmapPosition(
const glm::ivec2& position);
196 [[nodiscard]] glm::ivec2 mapPosition(
const glm::ivec2& position);
201 virtual void onCloseButtonClicked();
205 void showTouchscreenKeyboardImpl()
override;
206 void hideTouchscreenKeyboardImpl()
override;
253 HICON mIcon =
nullptr;
254 virtual LRESULT winProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
255#elif AUI_PLATFORM_ANDROID
256#elif AUI_PLATFORM_APPLE
258 AWindowNativePtr mHandle = 0;
259 WindowStyle mWindowStyle = WindowStyle::DEFAULT;
261 virtual void doDrawWindow();
262 virtual void onClosed();
269 void allowDragNDrop();
277 void createDevtoolsWindow()
override;
279 float fetchDpiFromSystem()
const override;
284 bool mFocusNextViewOnTab =
false;
289#elif AUI_PLATFORM_ANDROID
290#elif AUI_PLATFORM_LINUX
297 unsigned long counter;
298 } mXsyncRequestCounter;
299 bool mWasMaximized =
false;
303#ifdef AUI_PLATFORM_MACOS
304 bool mRedrawFlag =
false;
306 bool mRedrawFlag =
true;
311 unsigned mFrameMillis = 1;
321 friend LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
322#elif AUI_PLATFORM_ANDROID
323#elif AUI_PLATFORM_APPLE
325 unsigned long xGetWindowProperty(
unsigned long property,
unsigned long type,
unsigned char** value)
const;
326 void xSendEventToWM(
unsigned long atom,
long a,
long b,
long c,
long d,
long e)
const;
Definition: AOverlappingSurface.h:19
Represents a Unicode character string.
Definition: AString.h:37
bool consumesClick(const glm::ivec2 &pos) override
Determines whether this AView processes this click or passes it thru.
Definition: AViewContainerBase.cpp:369
void redraw()
Request window manager to redraw this AView.
Definition: AView.cpp:68
Definition: AWindowBase.h:33
virtual void blockUserInput(bool blockUserInput=true)
Enables or disables user input for this window.
Definition: AWindowBase.cpp:516
virtual _< AOverlappingSurface > createOverlappingSurfaceImpl(const glm::ivec2 &position, const glm::ivec2 &size)=0
void onPointerMove(glm::vec2 pos, const APointerMoveEvent &event) override
Handles pointer hover events.
Definition: AWindowBase.cpp:353
virtual void forceUpdateCursor()
Updates cursor by triggering onPointerMove on the same position (mMousePos).
Definition: AWindowBase.cpp:333
Definition: AWindowManager.h:23
Represents a window in the underlying windowing system.
Definition: AWindow.h:45
emits< glm::vec2 > moving
Window is moving.
Definition: AWindow.h:230
emits restored
Window is restored (shown from the taskbar, deiconified).
Definition: AWindow.h:245
AWindow(std::nullptr_t)
Constructor for custom initialization logic.
Definition: AWindow.h:275
emits maximized
Window is maximized.
Definition: AWindow.h:235
unsigned frameMillis() const noexcept override
Returns previous frame's rendering duration in millis.
Definition: AWindow.h:58
emits minimized
Window is minimized (hidden to the taskbar, iconified).
Definition: AWindow.h:240
Definition: CommonRenderingContext.h:28
Definition: OpenGLRenderingContext.h:23
Definition: SoftwareRenderingContext.h:17
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
AScreenOrientation
Controls screen orientation.
Definition: AScreenOrientation.h:20
Pointing method move event.
Definition: APointerMoveEvent.h:21