44class API_AUI_VIEWS AWindow:
public AWindowBase
46 friend class OpenGLRenderingContext;
47 friend class CommonRenderingContext;
48 friend class SoftwareRenderingContext;
49 friend class AWindowManager;
50 friend struct painter;
52 AWindow(
const AString& name =
"My window",
int width = 854_dp,
int height = 500_dp, AWindow* parent =
nullptr, WindowStyle ws = WindowStyle::DEFAULT) {
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;
173 static _<AWindow> wrapViewToWindow(
const _<AView>& view,
const AString& title,
int width = 854_dp,
int height = 500_dp, AWindow* parent =
nullptr, WindowStyle ws = WindowStyle::DEFAULT);
178 static AWindowBase* current();
186 [[nodiscard]] glm::ivec2 mapPositionTo(
const glm::ivec2& position, _<AWindow> other);
193 [[nodiscard]] glm::ivec2 unmapPosition(
const glm::ivec2& position);
200 [[nodiscard]] glm::ivec2 mapPosition(
const glm::ivec2& position);
204 void closeOverlappingSurfaceImpl(AOverlappingSurface* surface)
override;
205 virtual void onCloseButtonClicked();
209 void showTouchscreenKeyboardImpl()
override;
210 void hideTouchscreenKeyboardImpl()
override;
257 HICON mIcon =
nullptr;
258 virtual LRESULT winProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
259#elif AUI_PLATFORM_ANDROID
260#elif AUI_PLATFORM_APPLE
262 AWindowNativePtr mHandle = 0;
263 WindowStyle mWindowStyle = WindowStyle::DEFAULT;
265 virtual void doDrawWindow();
266 virtual void onClosed();
268 void windowNativePreInit(
const AString& name,
int width,
int height, AWindow* parent, WindowStyle ws);
281 void createDevtoolsWindow()
override;
283 float fetchDpiFromSystem()
const override;
293#elif AUI_PLATFORM_ANDROID
294#elif AUI_PLATFORM_LINUX
301 unsigned long counter;
302 } mXsyncRequestCounter;
303 bool mWasMaximized =
false;
307#ifdef AUI_PLATFORM_MACOS
308 bool mRedrawFlag =
false;
310 bool mRedrawFlag =
true;
315 unsigned mFrameMillis = 1;
325 friend LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
327#if AUI_PLATFORM_LINUX
328 unsigned long xGetWindowProperty(
unsigned long property,
unsigned long type,
unsigned char** value)
const;
329 void xSendEventToWM(
unsigned long atom,
long a,
long b,
long c,
long d,
long e)
const;
bool consumesClick(const glm::ivec2 &pos) override
Determines whether this AView processes this click or passes it thru.
Definition AViewContainerBase.cpp:371
virtual void blockUserInput(bool blockUserInput=true)
Enables or disables user input for this window.
Definition AWindowBase.cpp:518
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