Ultralight C++ API
1.4.0
Toggle main menu visibility
Main Page
Library Management
Renderer
Config
Platform API
Platform
Logger
GPUDriver
FontLoader
FileSystem
Clipboard
SurfaceFactory
ThreadFactory
View Management
View
ViewConfig
Session
View Callbacks
ViewListener
LoadListener
DownloadListener
NetworkListener
Input Events
MouseEvent
KeyEvent
ScrollEvent
GamepadEvent
GamepadAxisEvent
GamepadButtonEvent
Rendering Output
CPU Renderer
Surface
SurfaceFactory
BitmapSurface
GPU Renderer
GPUDriver
RenderTarget
CommandList
Command
GPUState
RenderBuffer
VertexBuffer
IndexBuffer
JavaScriptCore API
JSBase.h
JSContextRef.h
JSStringRef.h
JSValueRef.h
JSObjectRef.h
JSObjectRefPrivate.h
JSTypedArray.h
JSRetainPtr.h
AppCore API
App
Settings
Monitor
Window
Overlay
App Callbacks
AppListener
WindowListener
JSHelpers API
Global Functions
SetJSContext
GetJSContext
JSGlobalObject
JSEval
JSString
JSValue
JSObject
JSArray
JSArgs
JSPropertyValue
JSCallback
JSCallbackWithRetval
JSFunction
Utility Classes
String Classes
String
String8
String16
String32
StringSTL.h
Image Source
ImageSource
ImageSourceProvider
Bitmap
Buffer
FontFile
Rect
IntRect
Matrix
Matrix4x4
RefPtr
Full Class List
►
Ultralight C++ API
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
Site Home
Docs
Go to C API
JavaScript.h
Go to the documentation of this file.
1
/**************************************************************************************************
2
* This file is a part of Ultralight. *
3
* *
4
* See <https://ultralig.ht> for licensing and more. *
5
* *
6
* (C) 2024 Ultralight, Inc. *
7
**************************************************************************************************/
8
#pragma once
9
#include <
JavaScriptCore/JavaScript.h
>
10
#include <
Ultralight/Defines.h
>
11
#include <
Ultralight/RefPtr.h
>
12
#include <
Ultralight/String.h
>
13
14
namespace
ultralight
{
15
16
///
17
/// This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore)
18
/// and locks the context on the current thread for the duration of its lifetime.
19
///
20
class
UExport
JSContext
:
public
RefCounted
{
21
public
:
22
/// Get the underlying JSContextRef for use with JavaScriptCore C API
23
virtual
JSContextRef
ctx
() = 0;
24
25
/// Typecast to a JSContextRef for use with JavaScriptCore C API
26
operator
JSContextRef
();
27
28
protected
:
29
virtual
~JSContext
();
30
};
20
class
UExport
JSContext
:
public
RefCounted
{
…
};
31
32
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:25
JSContextRef
const struct OpaqueJSContext * JSContextRef
Definition
JSBase.h:43
JavaScript.h
RefPtr.h
String.h
Defines.h
ultralight::JSContext
This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) and lock...
Definition
JavaScript.h:20
ultralight::JSContext::ctx
virtual JSContextRef ctx()=0
Get the underlying JSContextRef for use with JavaScriptCore C API.
ultralight::JSContext::~JSContext
virtual ~JSContext()
ultralight::RefCounted
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition
RefPtr.h:47
ultralight
Definition
App.h:14
Ultralight
JavaScript.h