3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/gui/oreui/ScreenPerformanceTelemetry.h"
7#include "mc/client/gui/oreui/interface/IView.h"
8#include "mc/client/gui/oreui/interface/RouteMode.h"
9#include "mc/client/gui/oreui/interface/ViewState.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/external/gameface/cohtml/ControlType.h"
12#include "mc/external/gameface/cohtml/Cursors.h"
13#include "mc/external/gameface/cohtml/IViewListener.h"
14#include "mc/platform/brstd/flat_map.h"
27namespace OreUI {
class IScene; }
36namespace cohtml {
class View; }
42class View :
public ::OreUI::IView,
public ::cohtml::IViewListener {
46 ::ll::TypedStorage<8, 8, ::cohtml::View*> mGamefaceView;
47 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewRenderer>> mRenderer;
48 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::FocusNavigationBinding>> mFocusNavigationBinding;
49 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::FocusNavigationController>> mFocusNavigationController;
50 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewInputHandler>> mInputHandler;
51 ::ll::TypedStorage<8, 32, ::std::string> mUrl;
52 ::ll::TypedStorage<8, 24, ::std::vector<::std::reference_wrapper<::OreUI::IScene>>> mScenes;
53 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::BedrockInputSource>> mBedrockInputSource;
54 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IClientInstance>> mClientInstance;
55 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
56 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::ViewBindings>> mBindings;
57 ::ll::TypedStorage<8, 8, ::OreUI::ITelemetry&> mTelemetry;
58 ::ll::TypedStorage<8, 400, ::std::optional<::OreUI::ScreenPerformanceTelemetry>> mScreenPerformanceTelemetry;
59 ::ll::TypedStorage<1, 1, ::OreUI::ViewState> mState;
60 ::ll::TypedStorage<4, 4, ::OreUI::RouteMode> mRouteMode;
61 ::ll::TypedStorage<8, 8, double> mLastUpdateTime;
62 ::ll::TypedStorage<8, 8, double> mTimeStamp;
63 ::ll::TypedStorage<8, 8, ::Option*> mScreenAnimationsOption;
65 TypedStorage<8, 48, ::brstd::flat_map<int, uint64, ::std::less<int>, ::std::vector<int>, ::std::vector<uint64>>>
71 View& operator=(View
const&);
78 virtual ~View() =
default;
80 virtual void pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode) ;
82 virtual bool hasScenes() const ;
84 virtual
void removeScene(::OreUI::IScene const& scene) ;
86 virtual
void update(
double time) ;
88 virtual
void render(::ScreenContext& screenContext) ;
90 virtual
void renderOffscreen(::ScreenContext& screenContext) ;
92 virtual
void resize(uint width, uint height) ;
94 virtual
void reload() ;
96 virtual
void leave() ;
98 virtual
void onSuspend() ;
100 virtual
void onResume() ;
102 virtual
void onRouteChanged(
103 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
104 ::std::optional<::OreUI::RouterLocation> const& currentLocation
107 virtual ::std::string_view getUrl() const ;
109 virtual ::OreUI::RouteMode getRouteMode() const ;
111 virtual uint getWidth() const ;
113 virtual uint getHeight() const ;
115 virtual ::OreUI::ViewState getState() const ;
117 virtual
void setTextBoxState(::TextBoxStateChange const& stateChange) ;
119 virtual
void onKeyboardDismissed() ;
121 virtual
void setCaretLocation(
int caretLocation) ;
123 virtual
void triggerEvent(::std::
string const& eventName, ::std::
string const& eventData) ;
125 virtual ::std::unique_ptr<::IGamefaceTextInputProxy> getTextInputProxy() ;
127 virtual
void OnLoadFailed(
char const* url,
char const* error) ;
129 virtual
void OnReadyForBindings() ;
131 virtual
void OnBindingsReleased() ;
133 virtual ::cohtml::ScreenInfo OnScreenInfoRequested() ;
135 virtual
void OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type) ;
137 virtual
void OnCaretRectChanged(
int x,
int y, uint width, uint height) ;
140 OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*) ;
142 virtual ::cohtml::IClientSideSocket* OnCreateWebSocket(
143 ::cohtml::ISocketListener* listener,
145 char const** protocols,
149 virtual
void OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate) ;
151 virtual
void OnAudioStreamClosed(
int id) ;
153 virtual
void OnAudioStreamPlay(
int id) ;
155 virtual
void OnAudioStreamPause(
int id) ;
157 virtual
void OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels) ;
159 virtual
void OnAudioStreamEnded(
int id) ;
161 virtual
void OnAudioStreamVolumeChanged(
int id,
float volume) ;
163 virtual
void OnClipboardTextSet(
char const* text, uint lengthBytes) ;
165 virtual
void OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject) ;
167 virtual ::OreUI::IViewTestHelper* getViewTestHelper() ;
177 MCAPI
void $removeScene(::OreUI::
IScene const& scene);
179 MCAPI
void $update(
double time);
216 MCAPI
void $triggerEvent(::
std::
string const& eventName, ::
std::
string const& eventData);
222 MCAPI
void $OnReadyForBindings();
224 MCAPI
void $OnBindingsReleased();
232 MCNAPI
void $OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*);
235 ::cohtml::ISocketListener* listener,
237 char const** protocols,
Definition IClientInstance.h:5
Definition IGamefaceTextInputProxy.h:5
Definition KeyboardManager.h:5
Definition ViewBindings.h:7
Definition FocusNavigationBinding.h:7
Definition FocusNavigationController.h:7
Definition ITelemetry.h:7
Definition IViewTestHelper.h:7
Definition RouterLocation.h:7
Definition ViewRenderer.h:7
MCAPI::std::string_view $getUrl() const
MCAPI void $OnAudioDataReceived(int id, int samples, float **pcm, int channels)
MCAPI::OreUI::IViewTestHelper * $getViewTestHelper()
MCAPI void $OnAudioStreamPlay(int id)
MCAPI::OreUI::RouteMode $getRouteMode() const
MCAPI void $setTextBoxState(::TextBoxStateChange const &stateChange)
MCAPI void $OnCaretRectChanged(int x, int y, uint width, uint height)
MCAPI ::std::unique_ptr<::IGamefaceTextInputProxy > $getTextInputProxy()
MCAPI void $OnAudioStreamCreated(int id, int bitDepth, int channels, float samplingRate)
MCAPI void $OnClipboardTextGet(::cohtml::IViewListener::IClipboardData *setDataObject)
MCAPI uint $getHeight() const
MCAPI void $setCaretLocation(int caretLocation)
MCAPI void $OnAudioStreamClosed(int id)
MCAPI void $OnAudioStreamVolumeChanged(int id, float volume)
MCAPI void $onRouteChanged(::std::optional<::OreUI::RouterLocation > const &previousLocation, ::std::optional<::OreUI::RouterLocation > const ¤tLocation)
MCAPI void $OnClipboardTextSet(char const *text, uint lengthBytes)
MCAPI::cohtml::IClientSideSocket * $OnCreateWebSocket(::cohtml::ISocketListener *listener, char const *url, char const **protocols, uint protocolsCount)
MCAPI void $resize(uint width, uint height)
MCAPI void $OnAudioStreamEnded(int id)
MCAPI void $render(::ScreenContext &screenContext)
MCAPI void $pushCurrentScene(::OreUI::IScene &scene, ::OreUI::RouteMode routeMode)
MCAPI void $OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type)
MCAPI uint $getWidth() const
MCAPI void $onKeyboardDismissed()
MCAPI::OreUI::ViewState $getState() const
MCAPI void $OnAudioStreamPause(int id)
MCAPI void $renderOffscreen(::ScreenContext &screenContext)
MCAPI::cohtml::ScreenInfo $OnScreenInfoRequested()
MCAPI void $OnLoadFailed(char const *url, char const *error)
MCAPI bool $hasScenes() const
MCAPI void $OnCursorChanged(::cohtml::CursorTypes::Cursors cursor, char const *, float const *, float const *)
Definition ScreenContext.h:5
Definition IClientSideSocket.h:7
Definition ISocketListener.h:7
Definition TextBoxStateChange.h:5
Definition IViewListener.h:15
Definition ScreenInfo.h:7