Encapsulates basic UI system functionality. More...
#include <Coherent/Coherent/UIGT/UISystem.h>
Public Member Functions | |
virtual View * | CreateView (const ViewInfo &info, const char *url, ViewLoadPolicy policy=VLP_UseCacheOrLoad)=0 |
Creates a new UI View. More... | |
virtual View * | CreateView (const ViewInfo &info, const char *url, const char *scriptToExecute, ViewLoadPolicy policy=VLP_UseCacheOrLoad)=0 |
Creates a new UI View. More... | |
virtual UISystemRenderer * | CreateRenderer (renoir::RendererBackend *backend, renoir::ClickThroughProvider *clickThrough)=0 |
Creates the UI System renderer. All ViewRenderers are created through it so this is mandatory for drawing the Views. More... | |
virtual UISystemRenderer * | CreateRenderer (renoir::ClickThroughProvider *clickThrough)=0 |
Creates the UI System renderer. All ViewRenderers are created through it so this is mandatory for drawing the Views. This variant must be used when the UISystem is initialized with an external rendering library. More... | |
virtual void | InspectorJSMemoryStatsEnabled (bool enabled)=0 |
Enables/disables JS memory statistics in the inspector Memory stats are disabled by default to save computational resources. More... | |
virtual bool | AreInspectorJSMemoryStatsEnabled () const =0 |
Returns if the JS memory stats are enabled during inspector debugging. More... | |
virtual void | Uninitialize (bool terminateUIThread=true)=0 |
Destroys the UI system. More... | |
virtual void | Advance ()=0 |
Advances the timers of the UI. Should be called each frame. | |
virtual bool | HasLastAdvanceCompleted ()=0 |
Checks whether the last issued Advance has completed. More... | |
virtual void | SetInMemoryResourceCacheSize (unsigned int bytes)=0 |
Sets the in-memory cache capacity for loaded resources, such as decoded images, fonts, styles, etc. More... | |
virtual void | GetInMemoryResourceCacheUsage (unsigned *usedBytes, unsigned *capacity) const =0 |
Gets the in-memory cache currently used bytes and total capacity. The returned values will only be updated if you have called RequestInMemoryResourceCacheUsage and Advance prior to the call. More... | |
virtual void | RequestInMemoryResourceCacheUsage ()=0 |
Requests an update of the in-memory cache size and capacity which can then be read using GetInMemoryResourceCacheUsage. | |
virtual unsigned | Fence ()=0 |
Puts a fence in the underlying task queue and returns its id. Does nothing if the system is synchronous. More... | |
virtual void | WaitFor (unsigned fence)=0 |
Blocks the current thread until the specified fence has finished. Does nothing if the system is synchronous. More... | |
virtual void | EraseAllCookies ()=0 |
Deletes all cookies, both session-only and permanent. The in-memory cookies are purged and the disk file is removed. | |
virtual void | IgnoreSSLCertificateErrors (bool ignore)=0 |
Sets whether new SSL connections should ignore SSL connection errors. More... | |
virtual bool | IsIgnoringSSLCertificateErrors () const =0 |
Gets whether new SSL connections should ignore SSL connection errors. More... | |
virtual void | EnableVerboseNetworkLogging (bool enable)=0 |
Changes the connection setting for verbose network logging. More... | |
virtual bool | IsVerboseNetworkLoggingEnabled () const =0 |
Returns true if new connections are set to use verbose network logging. More... | |
virtual void | RegisterGamepad (unsigned id, const char *info, unsigned axesCount, unsigned buttonsCount)=0 |
Registers a new gamepad. All created views will receive the gamepadconnected event. More... | |
virtual void | UnregisterGamepad (unsigned id)=0 |
Unregisters a gamepad. All created views will receive the gamepaddisconnected event. More... | |
virtual void | UpdateGamepadState (const Coherent::UIGT::GamepadState &state)=0 |
Updates the state of a single gamepad. More... | |
virtual void | ClearFontCache ()=0 |
Clears the internal fonts cache. | |
virtual void | ClearFontCache (bool clearRenderingTextures)=0 |
Clears the internal fonts cache. Use this when using an external rendering library. More... | |
virtual bool | AddFont (const void *fontData, size_t dataSize)=0 |
Load the font data in memory in advance. More... | |
virtual void | AddBitmapFont (const char **imagesData, unsigned *imagesDataSize, unsigned imagesCount, const BitmapFontDescription &description)=0 |
Load the bitmap font using image files. More... | |
virtual void | AddBitmapFont (const ResourceResponseUIGT::UserImageData *userImages, unsigned imagesCount, const BitmapFontDescription &description)=0 |
Load the bitmap font using user images. More... | |
virtual bool | AddFontsFolder (const char *folder)=0 |
Add folder with fonts for lazy loading of font data. More... | |
virtual void | UserImagesChanged (const unsigned *images, unsigned count)=0 |
Trigger repaint of a user provided texture. Call this whenever the image is changed by logic external to the library. Make sure to have ImageHandle set for such images. More... | |
virtual void | ReplaceUserImage (const ResourceResponseUIGT::UserImageData &userImage)=0 |
Replace an already loaded user image. More... | |
virtual void | RunGarbageCollection (GarbageCollectMode mode)=0 |
Run garbage collection to free up CPU memory. More... | |
virtual void | LogMemoryUsage (LogMemoryUsageFlags flags=LMU_Short)=0 |
Logs the current memory usage of components known to hold big chunks of memory. JS heap - responsible for the lifetime of JS objects and exectution of scripts. Resource cache - most of the webpage resources are stored in memory to accelerate reading and avoid frequent disk operations. More... | |
virtual void | AddHyphenationDictionary (const char *locale, const char *dictData, size_t dataSize)=0 |
Load hyphenation dictionary for a given locale. More... | |
virtual void | RemoveHyphenationDictionary (const char *locale)=0 |
Unload hyphenation dictionary for a given locale. More... | |
Encapsulates basic UI system functionality.
|
pure virtual |
Load the bitmap font using image files.
imagesData | pointer to image files data. |
imagesDataSize | pointer to size of the image files. |
imagesCount | number of images |
description | Description of the bitmap font. |
|
pure virtual |
Load the bitmap font using user images.
userImages | pointer to UserImageData structs describing the images. |
imagesCount | number of images |
description | Description of the bitmap font. |
|
pure virtual |
Load the font data in memory in advance.
fontData | contains pointer to the font data loaded into memory |
dataSize | contains the size of the read font data |
|
pure virtual |
Add folder with fonts for lazy loading of font data.
folder | path to the folder with fonts |
|
pure virtual |
Load hyphenation dictionary for a given locale.
Once the dictionary is added the client can release its content
locale | pointer to the locale string which identifies the locale of the dictionary. Locale format must match the one used for the lang attribute |
dictData | pointer to the memory buffer with the content of the hyphenation dictionary |
dataSize | the size of the content memory buffer in bytes |
|
pure virtual |
Returns if the JS memory stats are enabled during inspector debugging.
|
pure virtual |
Clears the internal fonts cache. Use this when using an external rendering library.
clearRenderingTextures | whether the rendering textures should be cleared as well. This can affect other users of the rendering library. |
|
pure virtual |
Creates the UI System renderer. All ViewRenderers are created through it so this is mandatory for drawing the Views.
backend | the backend to use when rendering |
class | to supply methods for UI graphical queries for click-through detection |
|
pure virtual |
Creates the UI System renderer. All ViewRenderers are created through it so this is mandatory for drawing the Views. This variant must be used when the UISystem is initialized with an external rendering library.
class | to supply methods for UI graphical queries for click-through detection |
|
pure virtual |
Creates a new UI View.
info | an instance of the ViewInfo struct that describes all the parameters of the view |
url | the page to load when the view is created |
policy | defines if the View should use cached resources or reload everything from disk/server. The parameter is important during development with the 'coui' protocol. A resource might be modified but still available in the in-memory cache. In that case the View might use the cached version ignoring the cache. It's advisable to ignore the cache if loading a View that is being actively developed. In shipped builds always use the cache as it substantially improves load-speed and resources in shipped titles should be immutable. |
|
pure virtual |
Creates a new UI View.
info | an instance of the ViewInfo struct that describes all the parameters of the view |
url | the page to load when the view is created |
scriptToExecute | JavaScript code that will be executed on every new page at start |
policy | defines if the View should use cached resources or reload everything from disk/server. The parameter is important during development with the 'coui' protocol. A resource might be modified but still available in the in-memory cache. In that case the View might use the cached version ignoring the cache. It's advisable to ignore the cache if loading a View that is being actively developed. In shipped builds always use the cache as it substantially improves load-speed and resources in shipped titles should be immutable. |
|
pure virtual |
Changes the connection setting for verbose network logging.
enable | true when new connections should use VerboseNetworkLogging to log debug netowking information, false otherwise. |
|
pure virtual |
Puts a fence in the underlying task queue and returns its id. Does nothing if the system is synchronous.
|
pure virtual |
Gets the in-memory cache currently used bytes and total capacity. The returned values will only be updated if you have called RequestInMemoryResourceCacheUsage and Advance prior to the call.
usedBytes | variable to output the current usage of the cache, in bytes |
capacity | variable to output the current capacity of the cache, in bytes |
|
pure virtual |
Checks whether the last issued Advance has completed.
|
pure virtual |
Sets whether new SSL connections should ignore SSL connection errors.
ignore | true when new connections should ignore SSL errors, false otherwise. |
|
pure virtual |
Enables/disables JS memory statistics in the inspector Memory stats are disabled by default to save computational resources.
enabled | sets the JS memory stats to enabled/disabled |
|
pure virtual |
Gets whether new SSL connections should ignore SSL connection errors.
|
pure virtual |
Returns true if new connections are set to use verbose network logging.
|
pure virtual |
Logs the current memory usage of components known to hold big chunks of memory. JS heap - responsible for the lifetime of JS objects and exectution of scripts. Resource cache - most of the webpage resources are stored in memory to accelerate reading and avoid frequent disk operations.
flags | determines which components will be logged |
|
pure virtual |
Registers a new gamepad. All created views will receive the gamepadconnected event.
id | the unique identifier for the gamepad |
info | general information for the gamepad such as producer and model |
axesCount | the number of analog axes the gamepad has |
buttonsCount | the number of buttons the gamepad has |
|
pure virtual |
Unload hyphenation dictionary for a given locale.
locale | pointer to the locale string which identifies the locale of the dictionary. |
|
pure virtual |
Replace an already loaded user image.
This method can be used when you need to replace userImage data, e.g. when you want to resize or replace the texture. The only thing you need to keep unchanged is the ImageHandle it was loaded with.
userImage | is UserImageData struct describing the image. |
|
pure virtual |
Run garbage collection to free up CPU memory.
This method will invoke a garbage collection run with the specified mode to release unused memory.
mode | determines the mode in which the garbage collection runs |
|
pure virtual |
Sets the in-memory cache capacity for loaded resources, such as decoded images, fonts, styles, etc.
bytes | the new capacity of the cache, in bytes |
|
pure virtual |
Destroys the UI system.
terminateUIThread | whether to terminate the thread Coherent is running on in async mode. Set it to false if you need to initialize another system during the same application run. This flag is ignored if the system is synchronous. |
|
pure virtual |
Unregisters a gamepad. All created views will receive the gamepaddisconnected event.
id | the id of the gamepad to unregister |
|
pure virtual |
Updates the state of a single gamepad.
state | new state of the gamepad |
|
pure virtual |
Trigger repaint of a user provided texture. Call this whenever the image is changed by logic external to the library. Make sure to have ImageHandle set for such images.
images | array of image handles - id-s of the user provided images that are changed |
count | the number of changed images |
|
pure virtual |
Blocks the current thread until the specified fence has finished. Does nothing if the system is synchronous.
fence | an unique fence id returned by an earlier call to Fence |