![]() |
Ultralight C++ API 1.3.0
|
Namespaces | |
namespace | KeyCodes |
Namespace containing all the key-code definitions for KeyboardEvent. | |
Classes | |
class | App |
Main application singleton (use this if you want to let the library manage window creation). More... | |
class | AppListener |
Interface for all App-related events. More... | |
class | Bitmap |
Bitmap container with basic blitting and conversion routines. More... | |
class | BitmapSurface |
The default Surface implementation, backed by a Bitmap. More... | |
class | Buffer |
A fixed-size byte container for passing data around. More... | |
class | Clipboard |
User-defined clipboard interface. More... | |
struct | Command |
Command description. More... | |
struct | CommandList |
Command list,. More... | |
struct | Config |
Global config for Ultralight. More... | |
class | FileSystem |
User-defined file system interface. More... | |
class | FontFile |
Represents a font file, either on-disk path or in-memory file contents. More... | |
class | FontLoader |
User-defined font loader interface. More... | |
class | GamepadAxisEvent |
Event representing a change in gamepad axis state (eg, pressing a stick in a certain direction). More... | |
class | GamepadButtonEvent |
Event representing a change in gamepad button state (eg, pressing a button on a gamepad). More... | |
class | GamepadEvent |
Event representing a change in gamepad connection state. More... | |
class | GPUDriver |
User-defined GPU driver interface. More... | |
struct | GPUState |
GPU state description. More... | |
struct | IndexBuffer |
Vertex index buffer,. More... | |
struct | IntRect |
Integer Rectangle Helper. More... | |
class | JSArgs |
A vector of JSValues, used for passing around arguments in JSCallback. More... | |
class | JSArray |
JSArray wrapper that automatically manages lifetime and provides convenient access to indices and Array functions. More... | |
class | JSContext |
This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) and locks the context on the current thread for the duration of its lifetime. More... | |
class | JSFunction |
JSFunction wrapper that automatically manages lifetime and provides convenient function invocation operators. More... | |
class | JSObject |
JSObject wrapper that automatically manages lifetime and provides convenient access to properties. More... | |
class | JSPropertyValue |
Wrapper for JSObject property value (JSValue subclass). More... | |
class | JSString |
JavaScript String wrapper that automatically manages JSStringRef lifetime and provides helpful conversions. More... | |
class | JSValue |
JavaScript variant value wrapper that automatically manages JSValueRef lifetime and provides helpful conversions. More... | |
struct | JSValueNullTag |
Tag type used with the JSValue constructor to create "Null" types. More... | |
struct | JSValueUndefinedTag |
Tag type used with the JSValue constructor to create "Undefined" types. More... | |
class | KeyEvent |
Generic keyboard event representing a change in keyboard state. More... | |
class | LoadListener |
User-defined interface to listen for load-related events for a View. More... | |
class | LockedPixels |
Forward declaration for the LockedPixels class. More... | |
class | Logger |
User-defined logging interface. More... | |
struct | Matrix |
Transformation Matrix helper. More... | |
struct | Matrix4x4 |
4x4 Matrix Helper More... | |
class | Monitor |
Monitor class, represents a platform monitor. More... | |
class | MouseEvent |
Generic mouse event representing a change in mouse state. More... | |
class | Overlay |
Web-content overlay. More... | |
class | Platform |
Global platform singleton, manages user-defined platform handlers and global config. More... | |
struct | Rect |
Float Rectangle Helper. More... | |
class | RefCounted |
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer. More... | |
class | RefPtr |
A nullable smart pointer. More... | |
struct | RenderBuffer |
RenderBuffer description,. More... | |
class | Renderer |
Core renderer singleton for the library, coordinates all library functions. More... | |
struct | RenderTarget |
Rendering details for a View, to be used with your own GPUDriver. More... | |
struct | RoundedRect |
Rounded Rectangle Helper. More... | |
class | ScrollEvent |
Generic scroll event representing a change in scroll state. More... | |
class | Session |
Storage for browsing data (cookies, local storage, etc.) optionally persisted to disk. More... | |
struct | Settings |
App-specific settings. More... | |
class | String |
UTF-8 String container with conversions for UTF-16 and UTF-32. More... | |
class | String16 |
A UTF-16 string container. More... | |
class | String16Vector |
A UTF-16 string vector. More... | |
class | String32 |
A UTF-32 string container. More... | |
class | String8 |
A UTF-8 string container. More... | |
class | Surface |
Offscreen pixel buffer surface. More... | |
class | SurfaceFactory |
SurfaceFactory can be used to provide your own native Surface implementation. More... | |
struct | vec2 |
2D Vector Helper More... | |
struct | vec3 |
3D Vector Helper More... | |
struct | vec4 |
4D Vector Helper More... | |
struct | Vertex_2f_4ub_2f |
Vertex layout for path vertices, useful for synthesizing or modifying vertex data. More... | |
struct | Vertex_2f_4ub_2f_2f_28f |
Vertex layout for quad vertices, useful for synthesizing or modifying vertex data. More... | |
struct | VertexBuffer |
Vertex buffer,. More... | |
class | View |
Web-page container rendered to an offscreen surface that you display yourself. More... | |
struct | ViewConfig |
View-specific configuration settings. More... | |
class | ViewListener |
User-defined interface to listen for View-specific events. More... | |
class | Window |
Window class, represents a platform window. More... | |
class | WindowListener |
Interface for all Window-related events. More... | |
Typedefs | |
typedef std::function< void(const JSObject &, const JSArgs &)> | JSCallback |
JSCallback typedef used for binding C++ callbacks to JavaScript functions. | |
typedef std::function< JSValue(const JSObject &, const JSArgs &)> | JSCallbackWithRetval |
JSCallbackWithRetval typedef used for binding C++ callbacks to JavaScript functions with an optional return value. | |
typedef void(* | DestroyBufferCallback) (void *user_data, void *data) |
Function signature for a user-defined destruction callback to be optionally called when Buffer is destroyed. | |
typedef vec2 | Point |
Point is typedef'd to a 2D vector. | |
typedef uint32_t | IndexType |
Vertex index type. | |
typedef detail::selector< sizeof(wchar_t)>::Char16 | Char16 |
Functions | |
void | SetJSContext (JSContextRef ctx) |
Set the current JSContext. | |
JSContextRef | GetJSContext () |
Get the current JSContext. | |
JSObject | JSGlobalObject () |
Get the Global Object for the current JSContext. | |
JSValue | JSEval (const JSString &str) |
Evaluate a string of JavaScript and return a result. | |
FontLoader * | GetPlatformFontLoader () |
Get the native font loader for the current platform. | |
FileSystem * | GetPlatformFileSystem (const String &baseDir) |
Get the native file system for the current platform, creating it if it doesn't exist using the base directory provided. | |
Logger * | GetDefaultLogger (const String &logPath) |
Get the default logger (writes the log to a file on disk). | |
void | GetKeyIdentifierFromVirtualKeyCode (int virtual_key_code, String &key_identifier_result) |
Utility function for generating a key identifier string from a virtual key-code. | |
void | GetKeyFromVirtualKeyCode (int virtual_key_code, bool shift, String &key_result) |
Utility function for generating a key string from a virtual key-code. | |
bool | operator== (const Matrix &a, const Matrix &b) |
bool | operator!= (const Matrix &a, const Matrix &b) |
bool | operator== (const Matrix4x4 &a, const Matrix4x4 &b) |
bool | operator!= (const Matrix4x4 &a, const Matrix4x4 &b) |
SurfaceFactory * | GetBitmapSurfaceFactory () |
Get the default Bitmap Surface Factory singleton. | |
template<typename T > | |
RefPtr< T > | AdoptRef (T &reference) |
Helper for wrapping new objects with the RefPtr smart pointer. | |
template<class T > | |
void | swap (RefPtr< T > &a, RefPtr< T > &b) |
template<typename T , typename U > | |
bool | operator== (const RefPtr< T > &a, const RefPtr< U > &b) |
template<typename T , typename U > | |
bool | operator== (const RefPtr< T > &a, const U *b) |
template<typename T , typename U > | |
bool | operator== (const T *a, const RefPtr< U > &b) |
template<typename T , typename U > | |
bool | operator!= (const RefPtr< T > &a, const RefPtr< U > &b) |
template<typename T , typename U > | |
bool | operator!= (const RefPtr< T > &a, const U *b) |
template<typename T , typename U > | |
bool | operator!= (const T *a, const RefPtr< U > &b) |
typedef detail::selector<sizeof(wchar_t)>::Char16 ultralight::Char16 |
typedef void(* ultralight::DestroyBufferCallback) (void *user_data, void *data) |
Function signature for a user-defined destruction callback to be optionally called when Buffer is destroyed.
user_data | Pointer to user-defined user-data (this will be the same value as what was passed to Buffer::Create, if any) |
data | Pointer to raw Buffer data. |
typedef uint32_t ultralight::IndexType |
Vertex index type.
typedef std::function<void(const JSObject&, const JSArgs&)> ultralight::JSCallback |
typedef std::function<JSValue(const JSObject&, const JSArgs&)> ultralight::JSCallbackWithRetval |
typedef vec2 ultralight::Point |
Point is typedef'd to a 2D vector.
|
strong |
The various Bitmap formats.
|
strong |
Command types, used by Command::command_type.
Enumerator | |
---|---|
ClearRenderBuffer | |
DrawGeometry |
enum ultralight::Cursor |
Cursor types,.
|
strong |
|
strong |
|
strong |
Log levels, used with Logger::LogMessage.
Enumerator | |
---|---|
Error | |
Warning | |
Info |
|
strong |
Shader types, used by GPUState::shader_type.
Each of these correspond to a vertex/pixel shader pair. You can find stock shader code for these in the shaders
folder of the AppCore repo.
Enumerator | |
---|---|
Fill | |
FillPath |
|
strong |
enum ultralight::WindowFlags : uint8_t |
Window creation flags.
Enumerator | |
---|---|
kWindowFlags_Borderless | |
kWindowFlags_Titled | |
kWindowFlags_Resizable | |
kWindowFlags_Maximizable | |
kWindowFlags_Hidden |
RefPtr< T > ultralight::AdoptRef | ( | T & | reference | ) |
Helper for wrapping new objects with the RefPtr smart pointer.
All ref-counted object are created with an initial ref-count of '1'. The AdoptRef() helper returns a RefPtr<T> without calling AddRef(). This is used for creating new objects, like so:
RefPtr<Object> ref = AdoptRef(*new ObjectImpl());
SurfaceFactory * ultralight::GetBitmapSurfaceFactory | ( | ) |
Get the default logger (writes the log to a file on disk).
logPath | A file path to write the log to. |
JSContextRef ultralight::GetJSContext | ( | ) |
Get the current JSContext.
void ultralight::GetKeyFromVirtualKeyCode | ( | int | virtual_key_code, |
bool | shift, | ||
String & | key_result | ||
) |
Utility function for generating a key string from a virtual key-code.
virtual_key_code | The virtual key-code to generate the key string from. |
shift | Whether or not the shift key is currently pressed. |
key_result | The string to store the result in. |
void ultralight::GetKeyIdentifierFromVirtualKeyCode | ( | int | virtual_key_code, |
String & | key_identifier_result | ||
) |
Utility function for generating a key identifier string from a virtual key-code.
virtual_key_code | The virtual key-code to generate the key identifier from. |
key_identifier_result | The string to store the result in. |
FileSystem * ultralight::GetPlatformFileSystem | ( | const String & | baseDir | ) |
Get the native file system for the current platform, creating it if it doesn't exist using the base directory provided.
This is used to load data for file:/// URLs.
baseDir | An base file path that will be used to resolve relative file paths. You can optionally specify "@resource_path" on macOS to use the app bundle's resource path. |
FontLoader * ultralight::GetPlatformFontLoader | ( | ) |
Get the native font loader for the current platform.
Evaluate a string of JavaScript and return a result.
JSObject ultralight::JSGlobalObject | ( | ) |
Get the Global Object for the current JSContext.
In JavaScript, this would be equivalent to the "window" object.
bool ultralight::operator!= | ( | const RefPtr< T > & | a, |
const RefPtr< U > & | b | ||
) |
bool ultralight::operator!= | ( | const RefPtr< T > & | a, |
const U * | b | ||
) |
bool ultralight::operator!= | ( | const T * | a, |
const RefPtr< U > & | b | ||
) |
bool ultralight::operator== | ( | const RefPtr< T > & | a, |
const RefPtr< U > & | b | ||
) |
bool ultralight::operator== | ( | const RefPtr< T > & | a, |
const U * | b | ||
) |
bool ultralight::operator== | ( | const T * | a, |
const RefPtr< U > & | b | ||
) |
void ultralight::SetJSContext | ( | JSContextRef | ctx | ) |
Set the current JSContext.
Most JavaScriptCore C API calls require an active JavaScript execution context (JSContextRef). You can get the JSContextRef for a page via View::LockJSContext()
. This context changes with each page navigation.
Note: You MUST set a JSContext before using most of the C++ API below.