A System owns multiple Views. These Views share resources among them. It is usually enough to have just one System per application run. More...
Public Member Functions | |
virtual unsigned | GetId ()=0 |
virtual void | SetId (unsigned id)=0 |
virtual | ~System () |
virtual View * | CreateView (const ViewSettings &settings)=0 |
Creates a new View with the specified options. More... | |
virtual SystemCacheStats * | GetSystemCacheStats () const =0 |
Returns an objects that holds the current statistics of the system-wide caches. Remember to Release when done. More... | |
virtual void | ClearCachedUnusedImages ()=0 |
Removes all unused images (raster and svg) from internal caches. More... | |
virtual SystemRenderer * | CreateSystemRenderer (const SystemRendererSettings &settings)=0 |
Creates a new SystemRenderer. The SystemRenderer will hold rendering resources shared by all view renderers. More... | |
virtual SystemRenderer * | CreateSystemRendererWithExternalRenderingLibrary (const SystemRendererSettingsWithExternalRenderingLibrary &settings)=0 |
Creates a new SystemRenderer. The SystemRenderer will hold rendering resources shared by all view renderers. More... | |
virtual void | AddFontsFromFolder_DEPRECATED (const char *path)=0 |
Loads all fonts from the specified folder. The fonts can later be used in the Views Prefer using the RegisterFont API for better control over the loaded fonts. More... | |
virtual void | RegisterFont (const char *url, const FontDescription &desc=FontDescription(), Fonts::FontSDF useSDF=Fonts::SDF_Auto)=0 |
Registers a font that can be later used in the Views. This API is similar to a font-face rule and allows you to prepare font stream readers in advance, so that text can render without delays. Unlike the font-face rule, this API also allows you to load the font with its original description (using 'Auto' for weight or/and style with or without specifying specific family name for it). This API will load all available fonts from font collections (ttc, otc) when a specific font description isn't provided (use 'Auto' without family name). If any description is specified for a font collection, only the first font will be loaded under that description (same behavior as a font-face rule with font collection). More... | |
virtual void | AddUserFont (const char **imagesData, unsigned *imagesDataSize, unsigned imagesCount, const UserFontDescription &description)=0 |
Load the user font using image files. More... | |
virtual void | AddUserFont (const IAsyncResourceResponse::UserImageData *userImages, unsigned imagesCount, const UserFontDescription &description)=0 |
Load the user font using preloaded images. More... | |
virtual void | SetDefaultFallbackFontName_DEPRECATED (const char *name)=0 |
Loads font with given name from folders specified by AddFontsFromFolder. This font will be used when the another fond cannot be loaded or found as a default one. This font is a fallback if the font name used in a Style property is not found. If you want to change the default font that will be applied to all elements, you should change the value in LibraryParams::DefaultStyleFontFamily. More... | |
virtual void | Destroy ()=0 |
Destroys the System. More... | |
virtual void | Advance (TimePoint timeMilliseconds)=0 |
Advances the internal timers and inspector when available. More... | |
virtual void | RegisterGamepad (unsigned id, const char *info, unsigned axesCount, unsigned buttonsCount, void *reserved=nullptr)=0 |
Registers a new gamepad. All views will receive the gamepadconnected event. You can provide any number of axes and buttons though the standard mapping according to the HTML spec has 4 axes and 17 buttons which can be found here https://w3c.github.io/gamepad/#remapping. More... | |
virtual void | UnregisterGamepad (unsigned id)=0 |
Unregisters a gamepad. All views will receive the gamepaddisconnected event. More... | |
virtual void | UpdateGamepadState (const cohtml::GamepadState &state)=0 |
Updates the state of a single gamepad. More... | |
virtual void | UpdateGamepadStateExtended (const cohtml::GamepadStateExtended &state)=0 |
Updates the state of a single gamepad with motion tracking information. 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 | PreloadAndCacheStylesheet (const char *url)=0 |
Schedules a preload task for a given stylesheet and caches it upon successful parsing. More... | |
virtual bool | RemoveStylesheetCacheEntry (const char *url)=0 |
Clears data for a given stylesheet from the cache. More... | |
virtual void | ClearStylesheetCache ()=0 |
Clears all preloaded stylesheet data from the cache. More... | |
virtual void | PreloadAndCacheHTML (const char *url)=0 |
Schedules a preload task for a given HTML, parses it, and caches it. More... | |
virtual bool | RemoveHTMLCacheEntry (const char *url)=0 |
Clears data for a given HTML from the cache. More... | |
virtual void | ClearHTMLCache ()=0 |
Clears all preloaded HTML data from the cache. More... | |
A System owns multiple Views. These Views share resources among them. It is usually enough to have just one System per application run.
|
virtual |
|
pure virtual |
Loads all fonts from the specified folder. The fonts can later be used in the Views Prefer using the RegisterFont API for better control over the loaded fonts.
path | the name of the folder |
|
pure virtual |
Load the user 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 user font using preloaded images.
userImages | pointer to UserImageData structs describing the images. |
imagesCount | number of images |
description | Description of the bitmap font. |
|
pure virtual |
Advances the internal timers and inspector when available.
|
pure virtual |
Removes all unused images (raster and svg) from internal caches.
|
pure virtual |
Clears all preloaded HTML data from the cache.
|
pure virtual |
Clears all preloaded stylesheet data from the cache.
|
pure virtual |
Creates a new SystemRenderer. The SystemRenderer will hold rendering resources shared by all view renderers.
|
pure virtual |
Creates a new SystemRenderer. The SystemRenderer will hold rendering resources shared by all view renderers.
|
pure virtual |
Creates a new View with the specified options.
|
pure virtual |
Destroys the System.
|
pure virtual |
|
pure virtual |
Returns an objects that holds the current statistics of the system-wide caches. Remember to Release when done.
|
pure virtual |
Schedules a preload task for a given HTML, parses it, and caches it.
url | A URL for the HTML to be preloaded and cached. Must be a valid absolute URL. Spaces aren't allowed. |
|
pure virtual |
Schedules a preload task for a given stylesheet and caches it upon successful parsing.
url | A URL for the stylesheet to be preloaded and cached. Must be a valid URL. Spaces aren't allowed. |
|
pure virtual |
Registers a font that can be later used in the Views. This API is similar to a font-face rule and allows you to prepare font stream readers in advance, so that text can render without delays. Unlike the font-face rule, this API also allows you to load the font with its original description (using 'Auto' for weight or/and style with or without specifying specific family name for it). This API will load all available fonts from font collections (ttc, otc) when a specific font description isn't provided (use 'Auto' without family name). If any description is specified for a font collection, only the first font will be loaded under that description (same behavior as a font-face rule with font collection).
url | URL for the font to be loaded. Must be a valid URL. Spaces aren't allowed. |
desc | The description of the font to be loaded |
useSDF | Controls the method used when rendering fonts, same as the coh-font-sdf font-face property SDF reduces memory consumption but finer font details are lost. If you experience a loss of detail in font rendering, try turning SDF off. |
|
pure virtual |
Registers a new gamepad. All views will receive the gamepadconnected event. You can provide any number of axes and buttons though the standard mapping according to the HTML spec has 4 axes and 17 buttons which can be found here https://w3c.github.io/gamepad/#remapping.
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 |
reserved | reserved parameter. Set to nullptr |
|
pure virtual |
Clears data for a given HTML from the cache.
url | The URL for the HTML to be cleared from the cache. Must be the same URL used for its preloading. |
|
pure virtual |
Clears data for a given stylesheet from the cache.
url | The URL for the stylesheet to be cleared from cache. Must be the same URL used for its preloading. |
|
pure virtual |
Loads font with given name from folders specified by AddFontsFromFolder. This font will be used when the another fond cannot be loaded or found as a default one. This font is a fallback if the font name used in a Style property is not found. If you want to change the default font that will be applied to all elements, you should change the value in LibraryParams::DefaultStyleFontFamily.
name | name of the font to load as default fallback |
|
pure virtual |
|
pure virtual |
Unregisters a gamepad. All 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 |
Updates the state of a single gamepad with motion tracking information.
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 |