3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/CardinalDirection.h"
7#include "mc/client/gui/DirtyFlag.h"
8#include "mc/client/gui/controls/TextCharEventResult.h"
9#include "mc/client/gui/screens/ControlCollectionChange.h"
10#include "mc/client/gui/screens/GamepadCursorData.h"
11#include "mc/client/gui/screens/ScreenEvent.h"
12#include "mc/client/gui/screens/TextEditFocusedListener.h"
13#include "mc/deps/core/utility/NonOwnerPointer.h"
14#include "mc/deps/core/utility/pub_sub/Publisher.h"
15#include "mc/deps/core/utility/pub_sub/Subscription.h"
16#include "mc/deps/input/InputMode.h"
17#include "mc/deps/input/enums/ButtonState.h"
18#include "mc/deps/input/enums/DirectionId.h"
19#include "mc/deps/input/enums/FocusImpact.h"
44namespace Bedrock::PubSub::ThreadModel {
struct MultiThreaded; }
56 enum class DelayedCommandLocation :
int {
64 using Result = ::std::pair<::ui::DirtyFlag, bool>;
69 ::ll::TypedStorage<8, 64, ::std::function<::std::pair<::ui::DirtyFlag, bool>()>> mAction;
70 ::ll::TypedStorage<4, 4, ::ScreenView::DelayedCommandLocation> location;
78 ::ll::TypedStorage<4, 4, int> mTouchId;
79 ::ll::TypedStorage<4, 8, ::glm::vec2> mPreviousPosition;
80 ::ll::TypedStorage<4, 8, ::glm::vec2> mCurrentPosition;
84 using clock_type = ::std::chrono::steady_clock;
86 using duration_sec = ::std::chrono::duration<float, ::std::ratio<1, 1>>;
91 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTime;
92 ::ll::TypedStorage<4, 4, float> mTickTime;
93 ::ll::TypedStorage<8, 8, double> mLastRawJoystickEventTime;
94 ::ll::TypedStorage<4, 8, ::glm::vec2> mSize;
95 ::ll::TypedStorage<4, 4, int> mMenuUpButtonId;
96 ::ll::TypedStorage<4, 4, int> mMenuDownButtonId;
97 ::ll::TypedStorage<4, 4, int> mMenuLeftButtonId;
98 ::ll::TypedStorage<4, 4, int> mMenuRightButtonId;
99 ::ll::TypedStorage<4, 4, int> mMenuTabLeftButtonId;
100 ::ll::TypedStorage<4, 4, int> mMenuTabRightButtonId;
101 ::ll::TypedStorage<4, 8, ::std::array<uint, 2>> mPointerButtonIds;
102 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ScreenController>> mController;
103 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VisualTree>> mVisualTree;
104 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAlwaysBindControls;
105 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mInputControls;
106 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mScrollViewControls;
107 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mOutOfModalScopeScrollViewControls;
108 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAnimationControls;
109 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mFactoryControls;
110 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mTextEditBoxControls;
111 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mAlwaysListeningInputControls;
112 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mRenderableControls;
113 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mFlyingItemRendererControls;
114 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mSliderControls;
115 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mCustomRendererControls;
116 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::UIControl>>> mCustomFrameUpdateControls;
120 ::std::map<::std::vector<::std::shared_ptr<::UIControl>>*, ::std::vector<::std::shared_ptr<::UIControl>>>>
122 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScreenRenderBatch>> mRootRenderBatch;
123 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::UIAnimationController>> mAnimationController;
124 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint, ::std::vector<::std::weak_ptr<::UIControl>>>>
125 mReservedButtonUpEvents;
126 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mSelectedControl;
127 ::ll::TypedStorage<4, 4, ::InputMode> mInputMode;
128 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::LayoutManager>> mLayoutManager;
129 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::FocusManager>> mFocusManager;
130 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ITTSEventManager>> mTTSEventManager;
131 ::ll::TypedStorage<1, 1, bool> mTextToSpeechEnabled;
132 ::ll::TypedStorage<8, 32, ::std::string> mTTSSectionHeader;
133 ::ll::TypedStorage<4, 4, float> mCurrentSliderValue;
134 ::ll::TypedStorage<1, 1, bool> mIsGUIScaleSlider;
135 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::ui::CardinalDirection>> mControllerStickDirections;
136 ::ll::TypedStorage<4, 4, int> mControllerLastMoved;
137 ::ll::TypedStorage<4, 4, int> mCursorTick;
138 ::ll::TypedStorage<4, 4, float const> mControllerXThreshold;
139 ::ll::TypedStorage<4, 4, float const> mControllerYThreshold;
140 ::ll::TypedStorage<4, 72, ::glm::vec2[9]> mControllerStickValues;
141 ::ll::TypedStorage<4, 8, ::GamepadCursorData> mGamepadCursorData;
142 ::ll::TypedStorage<4, 8, ::glm::vec2> mGamepadCursorPosition;
143 ::ll::TypedStorage<1, 1, bool> mHasSetInitialPosition;
144 ::ll::TypedStorage<1, 1, bool> mGamepadCursorFocusModeEnabled;
145 ::ll::TypedStorage<1, 1, bool> mGamepadCursorMagnetEnabled;
146 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::UIControl>> mGamepadMagnetControl;
147 ::ll::TypedStorage<4, 4, float> mGamepadMoveTime;
148 ::ll::TypedStorage<4, 8, ::glm::vec2> mGamepadTrackedDirection;
149 ::ll::TypedStorage<1, 1, bool> mGamepadHasTapped;
150 ::ll::TypedStorage<4, 20, ::ScreenView::TouchPadData> mTouchPadData;
151 ::ll::TypedStorage<4, 8, ::glm::vec2> mPointerLocationPrevious;
152 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastPointInTime;
153 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mCurrentTime;
154 ::ll::TypedStorage<8, 8, ::std::chrono::nanoseconds> mTimeAccumulator;
155 ::ll::TypedStorage<8, 16, ::std::optional<::std::chrono::steady_clock::time_point>> mScreenEntranceTime;
156 ::ll::TypedStorage<8, 16, ::std::optional<::std::chrono::nanoseconds>> mTimeToFirstRender;
157 ::ll::TypedStorage<4, 4, ::std::chrono::duration<float, ::std::ratio<1, 1>>
const> mFixedAnimationUpdateRate;
158 ::ll::TypedStorage<4, 4, float> mKeyboardHeight;
159 ::ll::TypedStorage<1, 1, bool> mShouldShowKeyboard;
160 ::ll::TypedStorage<1, 1, bool> mInitKeyboard;
161 ::ll::TypedStorage<4, 4, float> mCurrentObfuscateTime;
162 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
163 ::ll::TypedStorage<8, 24, ::std::vector<::RectangleArea>> mInputAreas;
164 ::ll::TypedStorage<8, 8, ::UIMeasureStrategy&> mMeasureStrategy;
165 ::ll::TypedStorage<1, 1, bool> mCanMoveFocus;
166 ::ll::TypedStorage<1, 1, ::FocusImpact> mNextFocusAction;
167 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::UIControlFactory>> mControlFactory;
168 ::ll::TypedStorage<8, 40, ::std::queue<::ScreenEvent, ::std::deque<::ScreenEvent>>> mAnimationEvents;
169 ::ll::TypedStorage<8, 40, ::std::queue<::ScreenEvent, ::std::deque<::ScreenEvent>>> mCustomRendererEvents;
170 ::ll::TypedStorage<4, 8, ::glm::vec2> mStartLocation;
171 ::ll::TypedStorage<4, 4, float> mTimeUntilNextPointerHeldEvent;
172 ::ll::TypedStorage<4, 4, float> mDelayBetweenEachPointerHeldEvent;
173 ::ll::TypedStorage<1, 1, bool> mShouldSendPointerHeldEvents;
174 ::ll::TypedStorage<8, 24, ::std::vector<::ScreenView::DelayedCommand>> mDelayedCommands;
175 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ScreenViewProxy>> mProxy;
176 ::ll::TypedStorage<8, 40, ::std::queue<::std::string, ::std::deque<::std::string>>> mQueuedTextChange;
177 ::ll::TypedStorage<1, 1, bool> mIsExiting;
178 ::ll::TypedStorage<1, 1, bool> mIsEntering;
179 ::ll::TypedStorage<1, 1, bool> mIsInitialized;
180 ::ll::TypedStorage<1, 1, bool> mHasFocus;
181 ::ll::TypedStorage<1, 1, bool> mHasHadFocus;
182 ::ll::TypedStorage<1, 1, bool> mIsTerminating;
183 ::ll::TypedStorage<1, 1, bool> mDirectionalButtonWasPressed;
184 ::ll::TypedStorage<1, 1, bool> mDelayedFocusRefresh;
185 ::ll::TypedStorage<1, 1, ::TextEditFocusedListener> mTextEditFocusedListener;
186 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ScreenLoadTimeTracker>> mScreenLoadTimeTracker;
187 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mFocusChangeSub;
192 ScreenView& operator=(ScreenView
const&);
193 ScreenView(ScreenView
const&);
216 ::std::vector<::UIControl const*>& visited
223 MCAPI
void _fireSelectedStateChangeEvent(
::TextEditComponent const& textEditComponent,
bool state);
227 ::TextCharEventResult result,
234 ::std::weak_ptr<::UIControl> previousFocusControl,
235 ::std::weak_ptr<::UIControl> currentFocusControl
246 MCAPI
void _handlePointerLocation(
247 ::glm::vec2
const& position,
248 ::FocusImpact focusImpact,
249 bool forceHandleWhenMotionless,
250 bool isRightStickScrolling
260 ::std::shared_ptr<::UIControl> focusedControl,
261 bool excludeControlHeader,
262 bool notInterruptible
279 ::ui::CardinalDirection direction,
281 ::glm::vec2
const overridePos,
282 bool isRightStickScrolling
296 _updateFocusControl(
bool forceUpdate,
bool forceFocusToAdjust,
bool isRightStickScrolling,
bool isHandlingTextChar);
306 MCAPI ::std::string getScreenName()
const;
308 MCAPI
void handleButtonEvent(uint buttonId, ::ButtonState buttonState, ::FocusImpact focusImpact);
329 ::std::weak_ptr<::UIControl>
const& stateControl
Definition DataBindingComponent.h:5
Definition FocusManager.h:5
Definition ITTSEventManager.h:5
Definition KeyboardManager.h:5
Definition LayoutManager.h:5
Definition RectangleArea.h:5
Definition ScreenController.h:5
Definition ScreenInputContext.h:5
Definition ScreenLoadTimeTracker.h:5
Definition ScreenRenderBatch.h:5
Definition ScreenSettings.h:5
Definition ScreenViewProxy.h:5
Definition ScreenView.h:5
MCAPI void _switchTabToTargetIndex(::std::vector<::std::shared_ptr<::UIControl > > &tabControls, int targetIndex)
MCAPI::ScreenSettings const * _getScreenComponent() const
MCAPI void _setKeyboardHeight(float height)
MCAPI void _sendScrollEvent(::UIControl &parent, float delta) const
MCAPI void _updateFocusControl(bool forceUpdate, bool forceFocusToAdjust, bool isRightStickScrolling, bool isHandlingTextChar)
MCAPI void _changeInputControlCollection(::UIControl &control, ::ControlCollectionChange change, bool const isRemoveCallback)
static MCAPI bool _isFocusMagnetEnabled(::std::shared_ptr<::UIControl > const &control)
MCAPI void _executeDelayedCommands(::ScreenView::DelayedCommandLocation location)
MCAPI void _adjustScrollToControl(::UIControl &control)
MCAPI void _adjustScrollToFocusedControl(::UIControl &focusedControl, bool selectNearestControl, bool isRightStickScrolling)
MCAPI void _selectNextFocusObject(::ui::CardinalDirection direction, bool overrideOrigin, ::glm::vec2 const overridePos, bool isRightStickScrolling)
MCAPI void _bindData(bool doAllBinds)
MCAPI void _scrollToGridItem(::UIControl *gridControl, int itemIndex, int numItems)
MCAPI void _advanceToNextTab(bool right)
static MCAPI bool _shouldBindChildren(bool doAllBinds, ::UIControl &control, ::DataBindingComponent &dataBinding)
MCAPI void _resetFocusedControl()
MCAPI void _queueTextToSpeechIfEnabled(::std::shared_ptr<::UIControl > focusedControl, bool excludeControlHeader, bool notInterruptible)
static MCAPI bool & sIsDebuggingFocus()
MCAPI void _debugRenderControl(::UIRenderContext &context, ::UIControl const &control) const
MCAPI void _setGamepadCursorFocusMode(bool focusModeEnabled)
MCAPI void _handleStickScrolling(::DirectionId directionId)
MCAPI void _debugRenderFocusControl(::UIRenderContext &context, ::UIControl const &control, ::std::vector<::UIControl const * > &visited) const
MCAPI void _processControllerDirection(::DirectionId directionId)
MCAPI bool isGamepadDeflectionModeEnabled() const
MCAPI void _resetInputControl(::UIControl &control, ::InputComponent *const inputComponent, bool const handleModalChange)
static MCAPI bool & sRenderDebugControls()
MCAPI void _resetButtonState(::UIControl &control)
static MCAPI bool _hasStateControlInDifferentTree(::UIControl const *currentVisualTreeRoot, ::std::weak_ptr<::UIControl > const &stateControl)
MCAPI::std::string getRoute() const
MCAPI void setInitialized()
MCAPI void _updateKeyboardVisibility()
static MCAPI ::Bedrock::PubSub::Publisher< void(), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0 > & mDebugChangePublisher()
MCAPI void cleanInputComponents()
MCAPI void _deselectControl(bool forceDeselect, bool hoverAfterDeselect)
MCAPI void _queueTextToSpeechTextboxCharacter(::std::string const &inputStr)
MCAPI bool handlePointerLocation(::glm::vec2 const &position, bool forceMotionlessPointer, ::FocusImpact focusImpact)
MCAPI ::std::shared_ptr<::UIControl > _getGamepadCursorFocusedControl() const
MCAPI void _processEvents(::ScreenInputContext &context)
MCAPI void _selectControl(::UIControl &control, bool isHandlingTextChar)
MCAPI void _handleDirtyVisualTree(bool overrideFocusControl, bool doAllBinds)
MCAPI bool _updateControlCollections(bool overrideFocusControl)
MCAPI void _forwardEventToAnimationControls(::ScreenEvent const &screenEvent)
MCAPI void _updateInputAreas()
MCAPI void _focusChangeCallback(::std::weak_ptr<::UIControl > previousFocusControl, ::std::weak_ptr<::UIControl > currentFocusControl)
MCAPI void _fireTextChangedEvent(bool finished, ::TextCharEventResult result, uint id, int index, ::UIPropertyBag *propertyBag)
Definition TextEditComponent.h:5
Definition UIAnimationController.h:5
Definition UIControlFactory.h:5
Definition UIMeasureStrategy.h:5
Definition UIPropertyBag.h:5
Definition UIRenderContext.h:5
Definition VisualTree.h:5
Definition MultiThreaded.h:7
Definition ScreenEvent.h:5
Definition ScreenView.h:18
Definition ScreenView.h:16