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"
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
void onKeyboardDismissed() ;
124 virtual
void setCaretLocation(
int caretLocation) ;
126 virtual
void triggerEvent(::std::
string const& eventName, ::std::
string const& eventData) ;
128 virtual ::std::unique_ptr<::IGamefaceTextInputProxy> getTextInputProxy() ;
130 virtual
void OnLoadFailed(
char const* url,
char const* error) ;
132 virtual
void OnReadyForBindings() ;
134 virtual
void OnBindingsReleased() ;
136 virtual ::cohtml::ScreenInfo OnScreenInfoRequested() ;
138 virtual
void OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type) ;
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*
146 OnCreateWebSocket(::cohtml::ISocketListener*,
char const*,
char const**, uint) ;
148 virtual
void OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate) ;
150 virtual
void OnAudioStreamClosed(
int id) ;
152 virtual
void OnAudioStreamPlay(
int id) ;
154 virtual
void OnAudioStreamPause(
int id) ;
156 virtual
void OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels) ;
158 virtual
void OnAudioStreamEnded(
int id) ;
160 virtual
void OnAudioStreamVolumeChanged(
int id,
float volume) ;
162 virtual
void OnClipboardTextSet(
char const* text, uint lengthBytes) ;
164 virtual
void OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject) ;
166 virtual ::OreUI::IViewTestHelper* getViewTestHelper() ;
174 ::std::unique_ptr<::OreUI::BedrockInputSource> bedrockInputSource,
175 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> clientInstance,
176 ::KeyboardManager& keyboardManager,
177 ::std::unique_ptr<::OreUI::IFacetRegistry> facetRegistry,
178 ::OreUI::ITelemetry& telemetry
181 MCAPI
void flushAudioStreams();
183 MCAPI
void initialize(
184 ::cohtml::View& gamefaceView,
185 ::std::unique_ptr<::OreUI::ViewRenderer> renderer,
186 ::std::unique_ptr<::OreUI::ViewInputHandler> inputHandler,
187 ::OreUI::Detail::ViewContextFactory& contextFactory,
188 ::IOptionRegistry& options
197 ::std::unique_ptr<::OreUI::BedrockInputSource> bedrockInputSource,
198 ::Bedrock::NotNullNonOwnerPtr<::IClientInstance> clientInstance,
199 ::KeyboardManager& keyboardManager,
200 ::std::unique_ptr<::OreUI::IFacetRegistry> facetRegistry,
201 ::OreUI::ITelemetry& telemetry
214 MCAPI
void $pushCurrentScene(::OreUI::IScene& scene, ::OreUI::RouteMode routeMode);
216 MCAPI
bool $hasScenes() const;
218 MCAPI
void $removeScene(::OreUI::IScene const& scene);
220 MCAPI
void $update(
double time);
222 MCAPI
void $render(::ScreenContext& screenContext);
224 MCAPI
void $resize(uint width, uint height);
226 MCAPI
void $reload();
230 MCAPI
void $onSuspend();
232 MCAPI
void $onResume();
234 MCAPI
void $onRouteChanged(
235 ::std::optional<::OreUI::RouterLocation> const& previousLocation,
236 ::std::optional<::OreUI::RouterLocation> const& currentLocation
239 MCFOLD ::std::string_view $getUrl() const;
241 MCFOLD ::OreUI::RouteMode $getRouteMode() const;
243 MCAPI uint $getWidth() const;
245 MCAPI uint $getHeight() const;
247 MCFOLD ::OreUI::ViewState $getState() const;
249 MCAPI
void $setTextBoxState(::TextBoxStateChange const& stateChange);
251 MCAPI
void $onKeyboardDismissed();
253 MCAPI
void $setCaretLocation(
int caretLocation);
255 MCAPI
void $triggerEvent(::std::
string const& eventName, ::std::
string const& eventData);
257 MCAPI ::std::unique_ptr<::IGamefaceTextInputProxy> $getTextInputProxy();
259 MCAPI
void $OnLoadFailed(
char const* url,
char const* error);
261 MCAPI
void $OnReadyForBindings();
263 MCAPI
void $OnBindingsReleased();
265 MCAPI ::cohtml::ScreenInfo $OnScreenInfoRequested();
267 MCAPI
void $OnTextInputTypeChanged(::cohtml::TextInputControlType::ControlType type);
269 MCAPI
void $OnCaretRectChanged(
int x,
int y, uint width, uint height);
271 MCAPI
void $OnCursorChanged(::cohtml::CursorTypes::Cursors cursor,
char const*,
float const*,
float const*);
273 MCFOLD ::cohtml::IClientSideSocket* $OnCreateWebSocket(::cohtml::ISocketListener*,
char const*,
char const**, uint);
275 MCAPI
void $OnAudioStreamCreated(
int id,
int bitDepth,
int channels,
float samplingRate);
277 MCAPI
void $OnAudioStreamClosed(
int id);
279 MCAPI
void $OnAudioStreamPlay(
int id);
281 MCAPI
void $OnAudioStreamPause(
int id);
283 MCAPI
void $OnAudioDataReceived(
int id,
int samples,
float** pcm,
int channels);
285 MCAPI
void $OnAudioStreamEnded(
int id);
287 MCAPI
void $OnAudioStreamVolumeChanged(
int id,
float volume);
289 MCAPI
void $OnClipboardTextSet(
char const* text, uint lengthBytes);
291 MCAPI
void $OnClipboardTextGet(::cohtml::IViewListener::
IClipboardData* setDataObject);
293 MCFOLD ::OreUI::IViewTestHelper* $getViewTestHelper();
Definition IClientInstance.h:5
Definition IGamefaceTextInputProxy.h:5
Definition IOptionRegistry.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