AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AView.h
1/*
2 * AUI Framework - Declarative UI toolkit for modern C++20
3 * Copyright (C) 2020-2024 Alex2772 and Contributors
4 *
5 * SPDX-License-Identifier: MPL-2.0
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
12#pragma once
13
14#include <chrono>
15#include <functional>
16#include <array>
17
18#include <glm/glm.hpp>
19
20#include "AUI/Common/ASmallVector.h"
21#include <AUI/ASS/Property/IProperty.h>
22#include <AUI/ASS/Property/ScrollbarAppearance.h>
23#include "AUI/Common/ABoxFields.h"
24#include "AUI/Common/ADeque.h"
25#include "AUI/Common/AObject.h"
26#include "AUI/Common/SharedPtr.h"
27#include "AUI/Platform/ACursor.h"
28#include "AUI/Platform/AInput.h"
29#include "AUI/Reflect/AClass.h"
30#include "AUI/Font/AFontStyle.h"
31#include "AUI/Util/AFieldSignalEmitter.h"
32#include "AUI/Render/ARenderContext.h"
33#include "AUI/Util/IBackgroundEffect.h"
34#include <AUI/ASS/PropertyListRecursive.h>
35#include <AUI/Enum/AOverflow.h>
36#include <AUI/Enum/Visibility.h>
37#include <AUI/Enum/MouseCollisionPolicy.h>
38#include <AUI/Util/ALayoutDirection.h>
39#include <AUI/Action/AMenu.h>
40
41#include <AUI/Event/AScrollEvent.h>
42#include <AUI/Event/AGestureEvent.h>
43#include <AUI/Event/APointerPressedEvent.h>
44#include <AUI/Event/APointerReleasedEvent.h>
45#include <AUI/Event/APointerMoveEvent.h>
46#include <AUI/Render/ITexture.h>
47#include <AUI/Render/IRenderViewToTexture.h>
48#include <AUI/Enum/AFloat.h>
49#include <AUI/Common/AProperty.h>
50
51
52class AWindow;
53class AWindowBase;
55class AAnimator;
56class AAssHelper;
57class AStylesheet;
58
64
77class API_AUI_VIEWS AView: public AObject
78{
79 friend class AViewContainerBase;
80 friend class AViewContainer;
81 friend class IRenderViewToTexture;
82public:
83 AView();
84 ~AView() override;
85
86
90 auto enabled() const {
91 return APropertyDef {
92 this,
93 &AView::mEnabled,
94 &AView::setEnabled,
95 mEnabledChanged,
96 };
97 }
98
102 auto position() const {
103 return APropertyDef {
104 this,
106 &AView::setPosition,
108 };
109 }
110
114 auto size() const {
115 return APropertyDef {
116 this,
118 &AView::setSize,
120 };
121 }
122
134 auto expanding() const {
135 return APropertyDef {
136 this,
137 &AView::mExpanding,
138 [](AView& self, glm::ivec2 expanding) { self.setExpanding(expanding); },
139 mExpandingChanged,
140 };
141 }
142
146 auto visibility() const {
147 return APropertyDef {
148 this,
149 &AView::mVisibility,
150 &AView::setVisibility,
151 mVisibilityChanged,
152 };
153 }
154
158 void redraw();
159
164 AWindowBase* getWindow() const;
165
166 virtual void drawStencilMask(ARenderContext ctx);
167
175 virtual void render(ARenderContext ctx);
176
181 virtual void postRender(ARenderContext ctx);
182
183 void popStencilIfNeeded(ARenderContext ctx);
184
185 [[nodiscard]]
186 const AVector<AString>& getAssNames() const noexcept {
187 return mAssNames;
188 }
189
193 [[nodiscard]]
194 glm::ivec2 getPosition() const noexcept
195 {
196 return mPosition;
197 }
198
207 [[nodiscard]]
208 glm::ivec2 getCenterPointInWindow() const noexcept
209 {
210 return getPositionInWindow() + *size() / 2;
211 }
212
216 [[nodiscard]]
217 glm::ivec2 getSize() const noexcept
218 {
219 return mSize;
220 }
221
225 glm::ivec2 getMinSize() const noexcept {
226 return mMinSize;
227 }
228
229 void setMinSize(glm::ivec2 minSize) noexcept {
230 mMinSize = minSize;
231 }
232
233 virtual void markMinContentSizeInvalid();
234
239 mExtraStylesheet = std::move(extraStylesheet);
241 }
242
246 void setExtraStylesheet(AStylesheet&& extraStylesheet);
247
251 [[nodiscard]]
252 const _<AStylesheet>& extraStylesheet() const noexcept {
253 return mExtraStylesheet;
254 }
255
260 {
261 return mOverflow;
262 }
263 void setOverflow(AOverflow overflow)
264 {
265 mOverflow = overflow;
266 }
267
271 AOverflowMask getOverflowMask() const
272 {
273 return mOverflowMask;
274 }
275 void setOverflowMask(AOverflowMask overflow)
276 {
277 mOverflowMask = overflow;
278 }
279
283 float getBorderRadius() const {
284 return mBorderRadius;
285 }
286 void setBorderRadius(float radius) {
287 mBorderRadius = radius;
288 }
289
290 int getWidth() const
291 {
292 return mSize.x;
293 }
294
295 int getHeight() const
296 {
297 return mSize.y;
298 }
299
304 {
305 return !(mVisibility & Visibility::FLAG_CONSUME_SPACE) ? 0 : mSize.x + getTotalFieldHorizontal();
306 }
307
312 {
313 return !(mVisibility & Visibility::FLAG_CONSUME_SPACE) ? 0 : mSize.y + getTotalFieldVertical();
314 }
315
322 [[nodiscard]]
324 return getMinimumSize() + mMargin.occupiedSize();
325 }
326
331 [[nodiscard]]
333 {
334 ensureAssUpdated();
335 return mMargin;
336 }
337
342 void setMargin(const ABoxFields& margin) {
343 mMargin = margin;
344 }
345
353 virtual bool consumesClick(const glm::ivec2& pos);
354
359 [[nodiscard]]
361 {
362 ensureAssUpdated();
363 return mPadding;
364 }
365
370 void setPadding(const ABoxFields& padding) {
371 mPadding = padding;
372 }
373
377 virtual AString debugString() const;
378
382 [[nodiscard]]
384 return mPadding.horizontal() + mMargin.horizontal();
385 }
386
390 [[nodiscard]]
392 return mPadding.vertical() + mMargin.vertical();
393 }
394
398 [[nodiscard]]
399 glm::ivec2 getTotalFieldSize() const {
401 }
402
406 AViewContainerBase* getParent() const
407 {
408 return mParent;
409 }
410
415 {
416 return mCursor;
417 }
418 void setCursor(AOptional<ACursor> cursor);
419
423 [[nodiscard]]
424 virtual int getContentMinimumWidth();
425
429 [[nodiscard]]
430 virtual int getContentMinimumHeight();
431
435 [[nodiscard]]
436 glm::ivec2 getContentMinimumSize() noexcept {
437 if (!mCachedMinContentSize) {
438 glm::ivec2 minContentSize = glm::ivec2(getContentMinimumWidth(), getContentMinimumHeight());
439 mCachedMinContentSize = minContentSize;
440 return minContentSize;
441 }
442 return *mCachedMinContentSize;
443 }
444
445 [[nodiscard]]
446 bool isContentMinimumSizeInvalidated() noexcept {
447 return !mCachedMinContentSize.hasValue();
448 }
449
450 bool hasFocus() const;
451
452 virtual int getMinimumWidth();
453 virtual int getMinimumHeight();
454
455 glm::ivec2 getMinimumSize() {
456 return { getMinimumWidth(), getMinimumHeight() };
457 }
458
459 void setMaxSize(const glm::ivec2& maxSize) {
460 mMaxSize = maxSize;
461 }
462
466 [[nodiscard]] const glm::ivec2& getMaxSize() const
467 {
468 return mMaxSize;
469 }
470
471 int getContentWidth() const
472 {
473 return static_cast<int>(mSize.x - mPadding.horizontal());
474 }
475
476 int getContentHeight() const
477 {
478 return static_cast<int>(mSize.y - mPadding.vertical());
479 }
480
481 [[nodiscard]]
482 const glm::ivec2& getExpanding() const
483 {
484 return mExpanding;
485 }
486
493 void setExpanding(glm::ivec2 expanding)
494 {
495 if (mExpanding == expanding) [[unlikely]] {
496 return;
497 }
498 mExpanding = expanding;
499 emit mExpandingChanged(expanding);
500 markMinContentSizeInvalid();
501 }
502
510 {
511 setExpanding(glm::ivec2(expanding));
512 }
513 void setExpanding()
514 {
515 setExpanding(2);
516 }
517
518 const _<AAnimator>& getAnimator() const {
519 return mAnimator;
520 }
521
522
523 void setAnimator(const _<AAnimator>& animator);
524 void getTransform(glm::mat4& transform) const;
525
526 [[nodiscard]]
527 int getExpandingHorizontal() const
528 {
529 return mExpanding.x;
530 }
531
532 [[nodiscard]]
533 int getExpandingVertical() const
534 {
535 return mExpanding.y;
536 }
537
538 [[nodiscard]] aui::float_within_0_1 getOpacity() const {
539 return mOpacity;
540 }
541 void setOpacity(aui::float_within_0_1 opacity) {
542 mOpacity = opacity;
543 }
544
545 virtual void setPosition(glm::ivec2 position);
546
551 void setSizeForced(glm::ivec2 size) {
552 mSize = size;
553 }
554 virtual void setSize(glm::ivec2 size);
555 virtual void setGeometry(int x, int y, int width, int height);
556 void setGeometry(const glm::ivec2& position, const glm::ivec2& size) {
557 setGeometry(position.x, position.y, size.x, size.y);
558 }
559
560 bool isBlockClicksWhenPressed() const noexcept {
561 return mBlockClicksWhenPressed;
562 }
563
564 void setBlockClicksWhenPressed(bool value) noexcept {
565 mBlockClicksWhenPressed = value;
566 }
567
572 const glm::ivec2& getFixedSize() {
573 return mFixedSize;
574 }
575 void setFixedSize(glm::ivec2 size) {
576 AUI_ASSERTX(glm::all(glm::greaterThanEqual(size, glm::ivec2(-100000))), "abnormal fixed size");
577 if (size == mFixedSize) [[unlikely]] {
578 return;
579 }
580 mFixedSize = size;
581 markMinContentSizeInvalid();
582 }
583
584 [[nodiscard]]
585 bool isMouseHover() const noexcept
586 {
587 return mHovered;
588 }
589
590 [[nodiscard]]
591 bool isPressed() const noexcept
592 {
593 return !mPressed.empty();
594 }
595
596 [[nodiscard]]
597 bool isPressed(APointerIndex index) const noexcept
598 {
599 return mPressed.contains(index);
600 }
601
602 bool isFocused() const {
603 return mHasFocus;
604 }
605 bool isMouseEntered() const {
606 return mMouseEntered;
607 }
608
609 Visibility getVisibility() const
610 {
611 return mVisibility;
612 }
613
614 Visibility getVisibilityRecursive() const;
615
616 void setVisibility(Visibility visibility) noexcept;
617
618 void setVisible(bool visible) noexcept
619 {
620 setVisibility(visible ? Visibility::VISIBLE : Visibility::INVISIBLE);
621 }
622
623 [[nodiscard]]
624 MouseCollisionPolicy getMouseCollisionPolicy() const {
625 return mMouseCollisionPolicy;
626 }
627
628 void setMouseCollisionPolicy(MouseCollisionPolicy mouseCollisionPolicy) {
629 mMouseCollisionPolicy = mouseCollisionPolicy;
630 }
631
635 void click() {
636 emit clickedButton(APointerIndex::button(AInput::LBUTTON));
637 emit clicked();
638 }
639
643 void pack();
644
650 void focus(bool needFocusChainUpdate = true);
651
657 virtual bool capturesFocus();
658
662 bool hasIndirectParent(const _<AView>& v);
663
667 [[nodiscard]] glm::ivec2 getPositionInWindow() const;
668
673 void addAssName(const AString& assName);
674
679 void removeAssName(const AString& assName);
680
692 inline AView& operator<<(const AString& assName) {
693 addAssName(assName);
694 return *this;
695 }
696
697 const _<AAssHelper>& getAssHelper() const {
698 return mAssHelper;
699 }
700
701 const ass::PropertyListRecursive& getCustomAss() const {
702 return mCustomStyleRule;
703 }
704
705 void setCustomStyle(ass::PropertyListRecursive rule);
706
707 void ensureAssUpdated();
708
709 [[nodiscard]]
710 _<AView> sharedPtr() {
711 return _cast<AView>(AObject::sharedPtr());
712 }
713
714 [[nodiscard]]
715 _weak<AView> weakPtr() {
716 return _weak<AView>(sharedPtr());
717 }
718
728 virtual bool onGesture(const glm::ivec2& origin, const AGestureEvent& event);
729
730 virtual void onMouseEnter();
731
741 virtual void onPointerMove(glm::vec2 pos, const APointerMoveEvent& event);
742 virtual void onMouseLeave();
743 virtual void onDpiChanged();
744
749 virtual void onPointerPressed(const APointerPressedEvent& event);
750
761 virtual void onPointerReleased(const APointerReleasedEvent& event);
762 virtual void onPointerDoubleClicked(const APointerPressedEvent& event);
763
768 virtual void onScroll(const AScrollEvent& event);
769 virtual void onKeyDown(AInput::Key key);
770 virtual void onKeyRepeat(AInput::Key key);
771 virtual void onKeyUp(AInput::Key key);
772 virtual void onFocusAcquired();
773 virtual void onFocusLost();
774 virtual void onCharEntered(char16_t c);
775
779 virtual bool handlesNonMouseNavigation();
780
781 virtual void forceUpdateLayoutRecursively();
782
783 virtual void setEnabled(bool enabled = true);
784
785 void setDisabled(bool disabled = true) {
786 setEnabled(!disabled);
787 }
788
789 void updateEnableState();
790
791 void enable()
792 {
793 setEnabled(true);
794 }
795 void disable()
796 {
797 setEnabled(false);
798 }
799
804 setCustomStyle(std::move(rule));
805 }
806
810 virtual void onClickPrevented();
811
826 virtual void invalidateAllStyles();
827
840 invalidateStateStylesImpl(getMinimumSizePlusMargin());
841 }
842
846 virtual void invalidateAssHelper();
847
851 [[nodiscard]]
852 virtual bool wantsTouchscreenKeyboard();
853
857 void setSkipUntilLayoutUpdate(bool skipUntilLayoutUpdate) {
858 mSkipUntilLayoutUpdate = skipUntilLayoutUpdate;
859 }
860
864 void setFloating(AFloat f) noexcept
865 {
866 mFloating = f;
867 }
868
872 [[nodiscard]]
873 AFloat getFloating() const noexcept
874 {
875 return mFloating;
876 }
877
878signals:
883
884 emits<bool> hoveredState;
885 emits<> mouseEnter;
886 emits<> mouseLeave;
887
888 emits<bool, APointerIndex> pressedState;
889 emits<APointerIndex> pressed;
890 emits<APointerIndex> released;
891
896
901
906
911
916
921
926
931
932 emits<APointerIndex> doubleClicked;
933
934 emits<> customCssPropertyChanged;
935
941 emits<> focusAcquired;
942 emits<> focusLost;
943
944 emits<_<AView>> childFocused;
945
946protected:
950 AViewContainerBase* mParent = nullptr;
951
955 std::array<ass::prop::IPropertyBase*, int(ass::prop::PropertySlot::COUNT)> mAss;
956
961
966
970 glm::ivec2 mPosition = { 0, 0 };
971
976
980 glm::ivec2 mSize = { 20, 20 };
981
986
987 AOptional<glm::ivec2> mCachedMinContentSize;
988 bool mMarkedMinContentSizeInvalid = false;
989
997 bool mRedrawRequested = false;
998
1002 glm::ivec2 mMinSize = {0, 0};
1003
1007 glm::ivec2 mMaxSize = {0x7fffffff, 0x7fffffff};
1008
1012 glm::ivec2 mFixedSize = {0, 0};
1013
1018
1023
1030
1039
1053 bool transformGestureEventsToDesktop(const glm::ivec2& origin, const AGestureEvent& event);
1054
1055 void applyAssRule(const ass::PropertyList& propertyList);
1056 void applyAssRule(const ass::PropertyListRecursive& propertyList);
1057
1062 virtual AMenuModel composeContextMenu();
1063
1072 virtual void onViewGraphSubtreeChanged();
1073
1078 virtual void markPixelDataInvalid(ARect<int> invalidArea);
1079
1080 virtual void commitStyle();
1081
1082private:
1086 _<AAnimator> mAnimator;
1087
1091 AOverflowMask mOverflowMask = AOverflowMask::ROUNDED_RECT;
1092
1096 Visibility mVisibility = Visibility::VISIBLE;
1097 emits<Visibility> mVisibilityChanged;
1098
1102 _<AAssHelper> mAssHelper;
1103
1107 float mBorderRadius = 0;
1108
1112 MouseCollisionPolicy mMouseCollisionPolicy = MouseCollisionPolicy::DEFAULT;
1113
1117 aui::float_within_0_1 mOpacity = 1;
1118
1122 AOverflow mOverflow = AOverflow::VISIBLE;
1123
1134 _<AStylesheet> mExtraStylesheet;
1135
1140 virtual void notifyParentEnabledStateChanged(bool enabled);
1141
1146 [[nodiscard]]
1147 ALayoutDirection parentLayoutDirection() const noexcept;
1148
1153 bool mMouseEntered = false;
1154
1160 bool mBlockClicksWhenPressed = true;
1161
1162 AFieldSignalEmitter<bool> mHovered = AFieldSignalEmitter<bool>(hoveredState, mouseEnter, mouseLeave);
1163 ASmallVector<APointerIndex, 1> mPressed;
1164
1165 bool mEnabled = true;
1166 emits<bool> mEnabledChanged;
1167
1168 bool mDirectlyEnabled = true;
1169 bool mParentEnabled = true;
1170 AFieldSignalEmitter<bool> mHasFocus = AFieldSignalEmitter<bool>(focusState, focusAcquired, focusLost, false);
1171
1172 glm::ivec2 mExpanding = glm::ivec2{0, 0};
1173 emits<glm::ivec2> mExpandingChanged;
1174
1178 AFloat mFloating = AFloat::NONE;
1179
1180 struct RenderToTexture {
1181 _unique<IRenderViewToTexture> rendererInterface;
1183
1184 bool drawFromTexture = true;
1185
1189 bool skipRedrawUntilTextureIsPresented = false;
1190 };
1191 AOptional<RenderToTexture> mRenderToTexture;
1192
1196 virtual void invalidateStateStylesImpl(glm::ivec2 prevMinimumSizePlusField);
1197
1198 void notifyParentChildFocused(const _<AView>& view);
1199};
1200
1201API_AUI_VIEWS std::ostream& operator<<(std::ostream& os, const AView& view);
Definition AAnimator.h:26
Remember, ASS is not a butt. ASS is Aui Style Sheets.
Definition AAssHelper.h:32
@ DEFAULT
Default arrow.
Definition ACursor.h:37
Stores a value and observes it's changes, emitting a signal.
Definition AFieldSignalEmitter.h:21
Utility wrapper implementing the stack-allocated (fast) optional idiom.
Definition AOptional.h:32
Wrapper class that stores either mouse button index or finger index.
Definition APointerIndex.h:21
Vector-like container consisting of few elements on stack and switches to dynamic allocation vector i...
Definition ASmallVector.h:34
Represents a Unicode character string.
Definition AString.h:37
Definition AStylesheet.h:21
A std::vector with AUI extensions.
Definition AVector.h:39
A view that represents a set of views.
Definition AViewContainerBase.h:68
Base class of all UI objects.
Definition AView.h:78
int getTotalFieldVertical() const
Definition AView.h:391
emits< AInput::Key > keyReleased
Keyboard key released.
Definition AView.h:920
AOptional< ACursor > mCursor
Determines shape which should pointer take when it's above this AView.
Definition AView.h:965
AOverflowMask getOverflowMask() const
Controls how does the overflow (stencil) mask is produced.
Definition AView.h:271
const ABoxFields & getMargin()
Returns the margin.
Definition AView.h:332
glm::ivec2 mSize
Size, including content area, border and padding.
Definition AView.h:980
bool transformGestureEventsToDesktop(const glm::ivec2 &origin, const AGestureEvent &event)
Converts touch screen events to desktop.
Definition AView.cpp:607
auto enabled() const
Whether view is enabled (i.e., reacts to user).
Definition AView.h:90
virtual int getContentMinimumHeight()
Definition AView.cpp:252
AVector< AString > mAssNames
ASS class names.
Definition AView.h:1029
void setExpanding(glm::ivec2 expanding)
Changes the expanding of view.
Definition AView.h:493
virtual void invalidateAssHelper()
Resets mAssHelper.
Definition AView.cpp:291
AFloat getFloating() const noexcept
Floating value for AText.
Definition AView.h:873
glm::ivec2 getCenterPointInWindow() const noexcept
The center point position of the view relatively to top left corner of the window.
Definition AView.h:208
int getTotalOccupiedWidth() const
Definition AView.h:303
auto expanding() const
Expansion coefficient. Hints layout manager how much this AView should be extended relative to other ...
Definition AView.h:134
auto size() const
Size, including content area, border and padding.
Definition AView.h:114
AViewContainerBase * mParent
Parent AView.
Definition AView.h:950
glm::ivec2 mPosition
Top left corner's position relative to top left corner's position of the parent AView.
Definition AView.h:970
virtual void onViewGraphSubtreeChanged()
Called when direct or indirect parent has changed.
Definition AView.cpp:695
glm::ivec2 getMinSize() const noexcept
Definition AView.h:225
bool mSkipUntilLayoutUpdate
If set to true, AViewContainer is obligated ignore this view. This value is set to false by AView::se...
Definition AView.h:1038
glm::ivec2 getPosition() const noexcept
Top left corner's position relative to top left corner's position of the parent AView.
Definition AView.h:194
void setFloating(AFloat f) noexcept
Set floating value for AText.
Definition AView.h:864
emits< glm::ivec2, glm::ivec2 > geometryChanged
Geometry (position and size) changed.
Definition AView.h:905
float getBorderRadius() const
border-radius, specified in ASS.
Definition AView.h:283
glm::ivec2 getTotalFieldSize() const
Definition AView.h:399
ass::PropertyListRecursive mCustomStyleRule
Custom ASS Rules.
Definition AView.h:960
ABoxFields mMargin
Margin, which defines the spacing around this AView. Processed by the layout manager.
Definition AView.h:1017
glm::ivec2 mFixedSize
Fixed size.
Definition AView.h:1012
glm::ivec2 getSize() const noexcept
Size, including content area, border and padding.
Definition AView.h:217
emits< glm::ivec2 > scrolled
Scroll event.
Definition AView.h:910
int getTotalFieldHorizontal() const
Definition AView.h:383
AViewContainerBase * getParent() const
Parent AView.
Definition AView.h:406
glm::ivec2 mMaxSize
Maximal size.
Definition AView.h:1007
void setExtraStylesheet(_< AStylesheet > extraStylesheet)
Definition AView.h:238
std::array< ass::prop::IPropertyBase *, int(ass::prop::PropertySlot::COUNT)> mAss
Drawing list, or baking drawing commands so that you don't have to parse the ASS every time.
Definition AView.h:955
void setSkipUntilLayoutUpdate(bool skipUntilLayoutUpdate)
Definition AView.h:857
virtual AMenuModel composeContextMenu()
Produce context (right click) menu.
Definition AView.cpp:398
virtual int getContentMinimumWidth()
Definition AView.cpp:248
emits< AInput::Key > keyPressed
Keyboard key pressed.
Definition AView.h:915
emits< APointerIndex > clickedButton
Some mouse button clicked.
Definition AView.h:895
emits clickedRightOrLongPressed
Right mouse button clicked or long press gesture applied.
Definition AView.h:930
bool mRedrawRequested
Redraw requested flag for this particular view/.
Definition AView.h:997
AOverflow getOverflow() const
Determines whether display graphics that go out of the bounds of this AView or not.
Definition AView.h:259
ABoxFields mPadding
Padding, which defines the spacing around content area inside the view. Processed by AView implementa...
Definition AView.h:1022
const ABoxFields & getPadding()
Returns the padding.
Definition AView.h:360
void setMargin(const ABoxFields &margin)
Sets the margin.
Definition AView.h:342
emits< bool > focusState
Focus state changed.
Definition AView.h:940
virtual void markPixelDataInvalid(ARect< int > invalidArea)
A view requests to redraw it and passes it's coords relative to this.
Definition AView.cpp:716
glm::ivec2 getPositionInWindow() const
Definition AView.cpp:474
emits viewGraphSubtreeChanged
Definition AView.h:882
const AOptional< ACursor > & getCursor() const
Determines shape which should pointer take when it's above this AView.
Definition AView.h:414
const _< AStylesheet > & extraStylesheet() const noexcept
Definition AView.h:252
glm::ivec2 getMinimumSizePlusMargin()
Definition AView.h:323
void click()
Definition AView.h:635
void invalidateStateStyles()
Updates state selectors for ASS.
Definition AView.h:839
const glm::ivec2 & getMaxSize() const
Definition AView.h:466
int getTotalOccupiedHeight() const
Definition AView.h:311
emits< glm::ivec2 > mPositionChanged
Position changed.
Definition AView.h:975
emits clickedRight
Right mouse button clicked.
Definition AView.h:925
void setSizeForced(glm::ivec2 size)
Definition AView.h:551
void operator+(ass::PropertyListRecursive rule)
Helper function for kAUI.h:with_style.
Definition AView.h:803
auto visibility() const
Visibility value.
Definition AView.h:146
emits< glm::ivec2 > mSizeChanged
Size changed.
Definition AView.h:985
glm::ivec2 getContentMinimumSize() noexcept
Definition AView.h:436
const glm::ivec2 & getFixedSize()
Fixed size.
Definition AView.h:572
void setExpanding(int expanding)
Changes the expanding of view.
Definition AView.h:509
emits clicked
Left mouse button clicked.
Definition AView.h:900
void setPadding(const ABoxFields &padding)
Sets the padding.
Definition AView.h:370
auto position() const
Top left corner's position relative to top left corner's position of the parent AView.
Definition AView.h:102
glm::ivec2 mMinSize
Minimal size.
Definition AView.h:1002
Definition AWindowBase.h:33
Represents a window in the underlying windowing system.
Definition AWindow.h:45
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
AOverflow
Controls visibility of the overflowed contents of AView with AView::drawStencilMask.
Definition AOverflow.h:24
AFloat
Specifies text floating in text wrapping views, i.e, ATextArea, AText.
Definition AFloat.h:19
@ VISIBLE
Overflowed contents are visible.
Definition AOverflow.h:28
@ NONE
Definition AFloat.h:23
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348
#define emit
emits the specified signal in context of this object.
Definition AObject.h:310
#define AUI_ASSERTX(condition, what)
Asserts that the passed condition evaluates to true. Adds extra message string.
Definition Assert.h:74
Represents a rectangle fields. Useful for margin and padding around AViews.
Definition ABoxFields.h:21
Property implementation to use with custom getter/setter.
Definition AProperty.h:308
Axis aligned 2D rectangle.
Definition ARect.h:24
Render context passed to AView::render.
Definition ARenderContext.h:43
Defines areas to invalidate (redraw).
Definition IRenderViewToTexture.h:32
Definition PropertyListRecursive.h:24
Definition PropertyList.h:25
Base class for all properties.
Definition IPropertyBase.h:50