Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
ultralight::Platform Class Referenceabstract

#include <Ultralight/platform/Platform.h>

Details

Global platform singleton, manages user-defined platform handlers and global config.

The library uses the Platform API for most platform-specific operations (eg, file access, clipboard, font loading, GPU access, etc.).

Overview of which platform handlers are required / optional / provided:
Renderer::Create() App::Create()
FileSystem Required Provided
FontLoader Required Provided
Clipboard Optional Provided
GPUDriver Optional Provided
Logger Optional Provided
SurfaceFactory Provided Provided
Note
This singleton should be set up before creating the Renderer or App.

Static Public Member Functions

static Platforminstance ()
 Get the Platform singleton.
 

Public Member Functions

virtual ~Platform ()
 
virtual void set_config (const Config &config)=0
 Set the Config.
 
virtual const Configconfig () const =0
 Get the Config.
 
virtual void set_logger (Logger *logger)=0
 Set the Logger (to handle error messages and debug output).
 
virtual Loggerlogger () const =0
 Get the Logger.
 
virtual void set_gpu_driver (GPUDriver *gpu_driver)=0
 Set the GPU Driver (will handle all rendering)
 
virtual GPUDrivergpu_driver () const =0
 Get the GPU Driver.
 
virtual void set_font_loader (FontLoader *font_loader)=0
 Set the Font Loader (will be used to map font families to actual fonts)
 
virtual FontLoaderfont_loader () const =0
 Get the Font Loader.
 
virtual void set_file_system (FileSystem *file_system)=0
 Set the File System (will be used for all file system operations)
 
virtual FileSystemfile_system () const =0
 Get the File System.
 
virtual void set_clipboard (Clipboard *clipboard)=0
 Set the Clipboard (will be used for all clipboard operations)
 
virtual Clipboardclipboard () const =0
 Get the Clipboard.
 
virtual void set_surface_factory (SurfaceFactory *surface_factory)=0
 Set the SurfaceFactory.
 
virtual SurfaceFactorysurface_factory () const =0
 Get the SurfaceFactory.
 

Constructor & Destructor Documentation

◆ ~Platform()

virtual ultralight::Platform::~Platform ( )
virtual

Member Function Documentation

◆ clipboard()

virtual Clipboard * ultralight::Platform::clipboard ( ) const
pure virtual

Get the Clipboard.

◆ config()

virtual const Config & ultralight::Platform::config ( ) const
pure virtual

Get the Config.

◆ file_system()

virtual FileSystem * ultralight::Platform::file_system ( ) const
pure virtual

Get the File System.

◆ font_loader()

virtual FontLoader * ultralight::Platform::font_loader ( ) const
pure virtual

Get the Font Loader.

◆ gpu_driver()

virtual GPUDriver * ultralight::Platform::gpu_driver ( ) const
pure virtual

Get the GPU Driver.

◆ instance()

static Platform & ultralight::Platform::instance ( )
static

Get the Platform singleton.

◆ logger()

virtual Logger * ultralight::Platform::logger ( ) const
pure virtual

Get the Logger.

◆ set_clipboard()

virtual void ultralight::Platform::set_clipboard ( Clipboard clipboard)
pure virtual

Set the Clipboard (will be used for all clipboard operations)

Parameters
clipboardA user-defined Clipboard implementation, ownership remains with the caller.

◆ set_config()

virtual void ultralight::Platform::set_config ( const Config config)
pure virtual

Set the Config.

◆ set_file_system()

virtual void ultralight::Platform::set_file_system ( FileSystem file_system)
pure virtual

Set the File System (will be used for all file system operations)

Parameters
file_systemA user-defined FileSystem implementation, ownership remains with the caller.

◆ set_font_loader()

virtual void ultralight::Platform::set_font_loader ( FontLoader font_loader)
pure virtual

Set the Font Loader (will be used to map font families to actual fonts)

Parameters
font_loaderA user-defined FontLoader implementation, ownership remains with the caller.

◆ set_gpu_driver()

virtual void ultralight::Platform::set_gpu_driver ( GPUDriver gpu_driver)
pure virtual

Set the GPU Driver (will handle all rendering)

Parameters
gpu_driverA user-defined GPUDriver implementation, ownership remains with the caller.

◆ set_logger()

virtual void ultralight::Platform::set_logger ( Logger logger)
pure virtual

Set the Logger (to handle error messages and debug output).

Parameters
loggerA user-defined Logger implementation, ownership remains with the caller.

◆ set_surface_factory()

virtual void ultralight::Platform::set_surface_factory ( SurfaceFactory surface_factory)
pure virtual

Set the SurfaceFactory.

This can be used to provide a platform-specific bitmap surface for View to paint into when the CPU renderer is enabled. See View::surface().

Parameters
surface_factoryA user-defined SurfaceFactory implementation, ownership remains with the caller.
Note
A default BitmapSurfaceFactory is defined if you never call this, View::surface() can be safely cast to BitmapSurface.

◆ surface_factory()

virtual SurfaceFactory * ultralight::Platform::surface_factory ( ) const
pure virtual

Get the SurfaceFactory.

Note
A default BitmapSurfaceFactory is set by default, View::surface() can be safely cast to BitmapSurface if you don't define your own.

The documentation for this class was generated from the following file: