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/deps/input/TextBoxCaretMovement.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"
28namespace OreUI {
class IScene; }
34namespace OreUI::Detail {
class Binder; }
39namespace cohtml {
class View; }
45class View :
public ::OreUI::IView,
public ::cohtml::IViewListener {
49 ::ll::TypedStorage<8, 8, ::cohtml::View*> mGamefaceView;
50 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewRenderer>> mRenderer;
51 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::ViewInputHandler>> mInputHandler;
52 ::ll::TypedStorage<8, 32, ::std::string const> mUrl;
53 ::ll::TypedStorage<8, 24, ::std::vector<::std::reference_wrapper<::OreUI::IScene>>> mScenes;
54 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::BedrockInputSource>> mBedrockInputSource;
55 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IClientInstance>> mClientInstance;
56 ::ll::TypedStorage<8, 8, ::KeyboardManager&> mKeyboardManager;
57 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::FacetBinder>> mFacetBinder;
58 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IFacetRegistry>> mFacetRegistry;
59 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::Binder>> mBinder;
60 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::Detail::ViewContext>> mViewContext;
61 ::ll::TypedStorage<8, 8, ::OreUI::ITelemetry&> mTelemetry;
62 ::ll::TypedStorage<8, 256, ::std::optional<::OreUI::ScreenPerformanceTelemetry>> mScreenPerformanceTelemetry;
63 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mUpdatedFacets;
64 ::ll::TypedStorage<1, 1, ::OreUI::ViewState> mState;
65 ::ll::TypedStorage<4, 4, ::OreUI::RouteMode> mRouteMode;
66 ::ll::TypedStorage<8, 8, double> mLastUpdateTime;
67 ::ll::TypedStorage<8, 8, double> mTimeStamp;
68 ::ll::TypedStorage<8, 8, ::Option*> mScreenAnimationsOption;
70 TypedStorage<8, 48, ::brstd::flat_map<int, uint64, ::std::less<int>, ::std::vector<int>, ::std::vector<uint64>>>
76 View& operator=(View
const&);
85 virtual void pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode) ;
87 virtual bool hasScenes() const ;
89 virtual
void removeScene(::OreUI::IScene const& scene) ;
91 virtual
void update(
double time) ;
93 virtual
void render(::ScreenContext& screenContext) ;
95 virtual
void resize(uint width, uint height) ;
97 virtual
void reload() ;
99 virtual
void leave() ;
101 virtual
void onSuspend() ;
103 virtual
void onResume() ;
105 virtual
void onRouteChanged(
106 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
107 ::std::optional<::OreUI::RouterLocation> const& currentLocation
110 virtual ::std::string_view getUrl() const ;
112 virtual ::OreUI::RouteMode getRouteMode() const ;
114 virtual uint getWidth() const ;
116 virtual uint getHeight() const ;
118 virtual ::OreUI::ViewState getState() const ;
120 virtual
void setTextBoxState(::TextBoxStateChange const& stateChange) ;
122 virtual ::std::optional<
int> calculateCaretPositionAfterMovement(::TextBoxCaretMovement movement) ;
124 virtual
void onKeyboardDismissed() ;
126 virtual
void setCaretLocation(
int caretLocation) ;
128 virtual
void triggerEvent(::std::
string const& eventName, ::std::
string const& eventData) ;
130 virtual ::std::unique_ptr<::IGamefaceTextInputProxy> getTextInputProxy() ;
132 virtual
void OnLoadFailed(
char const* url,
char const* error) ;
134 virtual
void OnReadyForBindings() ;
136 virtual
void OnBindingsReleased() ;
138 virtual ::cohtml::ScreenInfo OnScreenInfoRequested() ;
140 virtual
void OnCaretRectChanged(
int x,
int y, uint width, uint height) ;
143 OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*) ;
145 virtual ::cohtml::IClientSideSocket* OnCreateWebSocket(
146 ::cohtml::ISocketListener* listener,
148 char const** protocols,
152 virtual
void OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate) ;
154 virtual
void OnAudioStreamClosed(
int id) ;
156 virtual
void OnAudioStreamPlay(
int id) ;
158 virtual
void OnAudioStreamPause(
int id) ;
160 virtual
void OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels) ;
162 virtual
void OnAudioStreamEnded(
int id) ;
164 virtual
void OnAudioStreamVolumeChanged(
int id,
float volume) ;
166 virtual
void OnClipboardTextSet(
char const* text, uint lengthBytes) ;
168 virtual
void OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject) ;
170 virtual ::OreUI::IViewTestHelper* getViewTestHelper() ;
178 ::std::unique_ptr<::OreUI::BedrockInputSource> bedrockInputSource,
179 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> clientInstance,
180 ::KeyboardManager& keyboardManager,
181 ::std::unique_ptr<::OreUI::IFacetRegistry> facetRegistry,
182 ::OreUI::ITelemetry& telemetry
185 MCAPI
void _unload();
187 MCAPI
void flushAudioStreams();
189 MCAPI
void initialize(
190 ::cohtml::View& gamefaceView,
191 ::std::unique_ptr<::OreUI::ViewRenderer> renderer,
192 ::std::unique_ptr<::OreUI::ViewInputHandler> inputHandler,
193 ::OreUI::Detail::ViewContextFactory& contextFactory,
203 ::std::unique_ptr<::OreUI::BedrockInputSource> bedrockInputSource,
204 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> clientInstance,
205 ::KeyboardManager& keyboardManager,
206 ::std::unique_ptr<::OreUI::IFacetRegistry> facetRegistry,
207 ::OreUI::ITelemetry& telemetry
220 MCAPI
void $pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode);
222 MCAPI
bool $hasScenes() const;
224 MCAPI
void $removeScene(::OreUI::IScene const& scene);
226 MCAPI
void $update(
double time);
228 MCAPI
void $render(::ScreenContext& screenContext);
230 MCAPI
void $resize(uint width, uint height);
232 MCAPI
void $reload();
236 MCAPI
void $onSuspend();
238 MCAPI
void $onResume();
240 MCAPI
void $onRouteChanged(
241 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
242 ::std::optional<::OreUI::RouterLocation> const& currentLocation
245 MCAPI ::std::string_view $getUrl() const;
247 MCAPI ::OreUI::RouteMode $getRouteMode() const;
249 MCAPI uint $getWidth() const;
251 MCAPI uint $getHeight() const;
253 MCAPI ::OreUI::ViewState $getState() const;
255 MCAPI
void $setTextBoxState(::TextBoxStateChange const& stateChange);
257 MCAPI ::std::optional<
int> $calculateCaretPositionAfterMovement(::TextBoxCaretMovement movement);
259 MCAPI
void $onKeyboardDismissed();
261 MCAPI
void $setCaretLocation(
int caretLocation);
263 MCAPI
void $triggerEvent(::std::
string const& eventName, ::std::
string const& eventData);
265 MCAPI ::std::unique_ptr<::IGamefaceTextInputProxy> $getTextInputProxy();
267 MCAPI
void $OnLoadFailed(
char const* url,
char const* error);
269 MCAPI
void $OnReadyForBindings();
271 MCAPI
void $OnBindingsReleased();
273 MCAPI ::cohtml::ScreenInfo $OnScreenInfoRequested();
275 MCAPI
void $OnCaretRectChanged(
int x,
int y, uint width, uint height);
277 MCAPI
void $OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*);
279 MCFOLD ::cohtml::IClientSideSocket* $OnCreateWebSocket(
280 ::cohtml::ISocketListener* listener,
282 char const** protocols,
286 MCAPI
void $OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate);
288 MCAPI
void $OnAudioStreamClosed(
int id);
290 MCAPI
void $OnAudioStreamPlay(
int id);
292 MCAPI
void $OnAudioStreamPause(
int id);
294 MCAPI
void $OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels);
296 MCAPI
void $OnAudioStreamEnded(
int id);
298 MCAPI
void $OnAudioStreamVolumeChanged(
int id,
float volume);
300 MCAPI
void $OnClipboardTextSet(
char const* text, uint lengthBytes);
302 MCAPI
void $OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject);
304 MCFOLD ::OreUI::IViewTestHelper* $getViewTestHelper();
Definition IClientInstance.h:5
Definition IGamefaceTextInputProxy.h:5
Definition KeyboardManager.h:5
Definition ViewContextFactory.h:7
Definition ViewContext.h:7
Definition FacetBinder.h:7
Definition IFacetRegistry.h:7
Definition ITelemetry.h:7
Definition IViewTestHelper.h:7
Definition RouterLocation.h:7
Definition ViewRenderer.h:7
static MCAPI void ** $vftableForIViewListener()
static MCAPI void ** $vftableForIView()
Definition ScreenContext.h:5
Definition IClientSideSocket.h:7
Definition ISocketListener.h:7
Definition TextBoxStateChange.h:5
Definition IViewListener.h:15
Definition ScreenInfo.h:7