pub const JSC_OBJC_API_ENABLED: u32 = 0;
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
pub type size_t = ::std::os::raw::c_ulong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSContextGroup {
_unused: [u8; 0],
}
#[doc = " @typedef JSContextGroupRef A group that associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects."]
pub type JSContextGroupRef = *const OpaqueJSContextGroup;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSContext {
_unused: [u8; 0],
}
#[doc = " @typedef JSContextRef A JavaScript execution context. Holds the global object and other execution state."]
pub type JSContextRef = *const OpaqueJSContext;
#[doc = " @typedef JSGlobalContextRef A global JavaScript execution context. A JSGlobalContext is a JSContext."]
pub type JSGlobalContextRef = *mut OpaqueJSContext;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSString {
_unused: [u8; 0],
}
#[doc = " @typedef JSStringRef A UTF16 character buffer. The fundamental string representation in JavaScript."]
pub type JSStringRef = *mut OpaqueJSString;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSClass {
_unused: [u8; 0],
}
#[doc = " @typedef JSClassRef A JavaScript class. Used with JSObjectMake to construct objects with custom behavior."]
pub type JSClassRef = *mut OpaqueJSClass;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSPropertyNameArray {
_unused: [u8; 0],
}
#[doc = " @typedef JSPropertyNameArrayRef An array of JavaScript property names."]
pub type JSPropertyNameArrayRef = *mut OpaqueJSPropertyNameArray;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSPropertyNameAccumulator {
_unused: [u8; 0],
}
#[doc = " @typedef JSPropertyNameAccumulatorRef An ordered set used to collect the names of a JavaScript object's properties."]
pub type JSPropertyNameAccumulatorRef = *mut OpaqueJSPropertyNameAccumulator;
#[doc = " @typedef JSTypedArrayBytesDeallocator A function used to deallocate bytes passed to a Typed Array constructor. The function should take two arguments. The first is a pointer to the bytes that were originally passed to the Typed Array constructor. The second is a pointer to additional information desired at the time the bytes are to be freed."]
pub type JSTypedArrayBytesDeallocator = ::std::option::Option<
unsafe extern "C" fn(
bytes: *mut ::std::os::raw::c_void,
deallocatorContext: *mut ::std::os::raw::c_void,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpaqueJSValue {
_unused: [u8; 0],
}
#[doc = " @typedef JSValueRef A JavaScript value. The base type for all JavaScript values, and polymorphic functions on them."]
pub type JSValueRef = *const OpaqueJSValue;
#[doc = " @typedef JSObjectRef A JavaScript object. A JSObject is a JSValue."]
pub type JSObjectRef = *mut OpaqueJSValue;
extern "C" {
#[doc = "@function JSEvaluateScript"]
#[doc = "@abstract Evaluates a string of JavaScript."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param script A JSString containing the script to evaluate."]
#[doc = "@param thisObject The object to use as \"this,\" or NULL to use the global object as \"this.\""]
#[doc = "@param sourceURL A JSString containing a URL for the script's source file. This is used by debuggers and when reporting exceptions. Pass NULL if you do not care to include source file information."]
#[doc = "@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The JSValue that results from evaluating script, or NULL if an exception is thrown."]
pub fn JSEvaluateScript(
ctx: JSContextRef,
script: JSStringRef,
thisObject: JSObjectRef,
sourceURL: JSStringRef,
startingLineNumber: ::std::os::raw::c_int,
exception: *mut JSValueRef,
) -> JSValueRef;
}
extern "C" {
#[doc = "@function JSCheckScriptSyntax"]
#[doc = "@abstract Checks for syntax errors in a string of JavaScript."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param script A JSString containing the script to check for syntax errors."]
#[doc = "@param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions."]
#[doc = "@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1."]
#[doc = "@param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception."]
#[doc = "@result true if the script is syntactically correct, otherwise false."]
pub fn JSCheckScriptSyntax(
ctx: JSContextRef,
script: JSStringRef,
sourceURL: JSStringRef,
startingLineNumber: ::std::os::raw::c_int,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function JSGarbageCollect"]
#[doc = "@abstract Performs a JavaScript garbage collection."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@discussion JavaScript values that are on the machine stack, in a register,"]
#[doc = "protected by JSValueProtect, set as the global object of an execution context,"]
#[doc = "or reachable from any such value will not be collected."]
#[doc = ""]
#[doc = "During JavaScript execution, you are not required to call this function; the"]
#[doc = "JavaScript engine will garbage collect as needed. JavaScript values created"]
#[doc = "within a context group are automatically destroyed when the last reference"]
#[doc = "to the context group is released."]
pub fn JSGarbageCollect(ctx: JSContextRef);
}
pub const JSType_kJSTypeUndefined: JSType = 0;
pub const JSType_kJSTypeNull: JSType = 1;
pub const JSType_kJSTypeBoolean: JSType = 2;
pub const JSType_kJSTypeNumber: JSType = 3;
pub const JSType_kJSTypeString: JSType = 4;
pub const JSType_kJSTypeObject: JSType = 5;
pub const JSType_kJSTypeSymbol: JSType = 6;
#[doc = "@enum JSType"]
#[doc = "@abstract A constant identifying the type of a JSValue."]
#[doc = "@constant kJSTypeUndefined The unique undefined value."]
#[doc = "@constant kJSTypeNull The unique null value."]
#[doc = "@constant kJSTypeBoolean A primitive boolean value, one of true or false."]
#[doc = "@constant kJSTypeNumber A primitive number value."]
#[doc = "@constant kJSTypeString A primitive string value."]
#[doc = "@constant kJSTypeObject An object value (meaning that this JSValueRef is a JSObjectRef)."]
#[doc = "@constant kJSTypeSymbol A primitive symbol value."]
pub type JSType = ::std::os::raw::c_uint;
pub const JSTypedArrayType_kJSTypedArrayTypeInt8Array: JSTypedArrayType = 0;
pub const JSTypedArrayType_kJSTypedArrayTypeInt16Array: JSTypedArrayType = 1;
pub const JSTypedArrayType_kJSTypedArrayTypeInt32Array: JSTypedArrayType = 2;
pub const JSTypedArrayType_kJSTypedArrayTypeUint8Array: JSTypedArrayType = 3;
pub const JSTypedArrayType_kJSTypedArrayTypeUint8ClampedArray: JSTypedArrayType = 4;
pub const JSTypedArrayType_kJSTypedArrayTypeUint16Array: JSTypedArrayType = 5;
pub const JSTypedArrayType_kJSTypedArrayTypeUint32Array: JSTypedArrayType = 6;
pub const JSTypedArrayType_kJSTypedArrayTypeFloat32Array: JSTypedArrayType = 7;
pub const JSTypedArrayType_kJSTypedArrayTypeFloat64Array: JSTypedArrayType = 8;
pub const JSTypedArrayType_kJSTypedArrayTypeArrayBuffer: JSTypedArrayType = 9;
pub const JSTypedArrayType_kJSTypedArrayTypeNone: JSTypedArrayType = 10;
#[doc = "@enum JSTypedArrayType"]
#[doc = "@abstract A constant identifying the Typed Array type of a JSObjectRef."]
#[doc = "@constant kJSTypedArrayTypeInt8Array Int8Array"]
#[doc = "@constant kJSTypedArrayTypeInt16Array Int16Array"]
#[doc = "@constant kJSTypedArrayTypeInt32Array Int32Array"]
#[doc = "@constant kJSTypedArrayTypeUint8Array Uint8Array"]
#[doc = "@constant kJSTypedArrayTypeUint8ClampedArray Uint8ClampedArray"]
#[doc = "@constant kJSTypedArrayTypeUint16Array Uint16Array"]
#[doc = "@constant kJSTypedArrayTypeUint32Array Uint32Array"]
#[doc = "@constant kJSTypedArrayTypeFloat32Array Float32Array"]
#[doc = "@constant kJSTypedArrayTypeFloat64Array Float64Array"]
#[doc = "@constant kJSTypedArrayTypeArrayBuffer ArrayBuffer"]
#[doc = "@constant kJSTypedArrayTypeNone Not a Typed Array"]
#[doc = ""]
pub type JSTypedArrayType = ::std::os::raw::c_uint;
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns a JavaScript value's type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue whose type you want to obtain."]
#[doc = "@result A value of type JSType that identifies value's type."]
pub fn JSValueGetType(ctx: JSContextRef, value: JSValueRef) -> JSType;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the undefined type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the undefined type, otherwise false."]
pub fn JSValueIsUndefined(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the null type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the null type, otherwise false."]
pub fn JSValueIsNull(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the boolean type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the boolean type, otherwise false."]
pub fn JSValueIsBoolean(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the number type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the number type, otherwise false."]
pub fn JSValueIsNumber(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the string type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the string type, otherwise false."]
pub fn JSValueIsString(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the symbol type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the symbol type, otherwise false."]
pub fn JSValueIsSymbol(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value's type is the object type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value's type is the object type, otherwise false."]
pub fn JSValueIsObject(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value is an object with a given class in its class chain."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@param jsClass The JSClass to test against."]
#[doc = "@result true if value is an object and has jsClass in its class chain, otherwise false."]
pub fn JSValueIsObjectOfClass(
ctx: JSContextRef,
value: JSValueRef,
jsClass: JSClassRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value is an array."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value is an array, otherwise false."]
pub fn JSValueIsArray(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value is a date."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@result true if value is a date, otherwise false."]
pub fn JSValueIsDate(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns a JavaScript value's Typed Array type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue whose Typed Array type to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A value of type JSTypedArrayType that identifies value's Typed Array type, or kJSTypedArrayTypeNone if the value is not a Typed Array object."]
pub fn JSValueGetTypedArrayType(
ctx: JSContextRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> JSTypedArrayType;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether two JavaScript values are equal, as compared by the JS == operator."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param a The first value to test."]
#[doc = "@param b The second value to test."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result true if the two values are equal, false if they are not equal or an exception is thrown."]
pub fn JSValueIsEqual(
ctx: JSContextRef,
a: JSValueRef,
b: JSValueRef,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether two JavaScript values are strict equal, as compared by the JS === operator."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param a The first value to test."]
#[doc = "@param b The second value to test."]
#[doc = "@result true if the two values are strict equal, otherwise false."]
pub fn JSValueIsStrictEqual(ctx: JSContextRef, a: JSValueRef, b: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the JS instanceof operator."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to test."]
#[doc = "@param constructor The constructor to test against."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result true if value is an object constructed by constructor, as compared by the JS instanceof operator, otherwise false."]
pub fn JSValueIsInstanceOfConstructor(
ctx: JSContextRef,
value: JSValueRef,
constructor: JSObjectRef,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the undefined type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@result The unique undefined value."]
pub fn JSValueMakeUndefined(ctx: JSContextRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the null type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@result The unique null value."]
pub fn JSValueMakeNull(ctx: JSContextRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the boolean type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param boolean The bool to assign to the newly created JSValue."]
#[doc = "@result A JSValue of the boolean type, representing the value of boolean."]
pub fn JSValueMakeBoolean(ctx: JSContextRef, boolean: bool) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the number type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param number The double to assign to the newly created JSValue."]
#[doc = "@result A JSValue of the number type, representing the value of number."]
pub fn JSValueMakeNumber(ctx: JSContextRef, number: f64) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the string type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param string The JSString to assign to the newly created JSValue. The"]
#[doc = "newly created JSValue retains string, and releases it upon garbage collection."]
#[doc = "@result A JSValue of the string type, representing the value of string."]
pub fn JSValueMakeString(ctx: JSContextRef, string: JSStringRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value of the symbol type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param description A description of the newly created symbol value."]
#[doc = "@result A unique JSValue of the symbol type, whose description matches the one provided."]
pub fn JSValueMakeSymbol(ctx: JSContextRef, description: JSStringRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript value from a JSON formatted string."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param string The JSString containing the JSON string to be parsed."]
#[doc = "@result A JSValue containing the parsed value, or NULL if the input is invalid."]
pub fn JSValueMakeFromJSONString(ctx: JSContextRef, string: JSStringRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript string containing the JSON serialized representation of a JS value."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The value to serialize."]
#[doc = "@param indent The number of spaces to indent when nesting. If 0, the resulting JSON will not contains newlines. The size of the indent is clamped to 10 spaces."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSString with the result of serialization, or NULL if an exception is thrown."]
pub fn JSValueCreateJSONString(
ctx: JSContextRef,
value: JSValueRef,
indent: ::std::os::raw::c_uint,
exception: *mut JSValueRef,
) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Converts a JavaScript value to boolean and returns the resulting boolean."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to convert."]
#[doc = "@result The boolean result of conversion."]
pub fn JSValueToBoolean(ctx: JSContextRef, value: JSValueRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Converts a JavaScript value to number and returns the resulting number."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to convert."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The numeric result of conversion, or NaN if an exception is thrown."]
pub fn JSValueToNumber(ctx: JSContextRef, value: JSValueRef, exception: *mut JSValueRef)
-> f64;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Converts a JavaScript value to string and copies the result into a JavaScript string."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to convert."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSString with the result of conversion, or NULL if an exception is thrown. Ownership follows the Create Rule."]
pub fn JSValueToStringCopy(
ctx: JSContextRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Converts a JavaScript value to object and returns the resulting object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to convert."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The JSObject result of conversion, or NULL if an exception is thrown."]
pub fn JSValueToObject(
ctx: JSContextRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Protects a JavaScript value from garbage collection."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to protect."]
#[doc = "@discussion Use this method when you want to store a JSValue in a global or on the heap, where the garbage collector will not be able to discover your reference to it."]
#[doc = ""]
#[doc = "A value may be protected multiple times and must be unprotected an equal number of times before becoming eligible for garbage collection."]
pub fn JSValueProtect(ctx: JSContextRef, value: JSValueRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Unprotects a JavaScript value from garbage collection."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param value The JSValue to unprotect."]
#[doc = "@discussion A value may be protected multiple times and must be unprotected an"]
#[doc = "equal number of times before becoming eligible for garbage collection."]
pub fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef);
}
pub const kJSPropertyAttributeNone: ::std::os::raw::c_uint = 0;
pub const kJSPropertyAttributeReadOnly: ::std::os::raw::c_uint = 2;
pub const kJSPropertyAttributeDontEnum: ::std::os::raw::c_uint = 4;
pub const kJSPropertyAttributeDontDelete: ::std::os::raw::c_uint = 8;
#[doc = "@enum JSPropertyAttribute"]
#[doc = "@constant kJSPropertyAttributeNone Specifies that a property has no special attributes."]
#[doc = "@constant kJSPropertyAttributeReadOnly Specifies that a property is read-only."]
#[doc = "@constant kJSPropertyAttributeDontEnum Specifies that a property should not be enumerated by JSPropertyEnumerators and JavaScript for...in loops."]
#[doc = "@constant kJSPropertyAttributeDontDelete Specifies that the delete operation should fail on a property."]
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
#[doc = "@typedef JSPropertyAttributes"]
#[doc = "@abstract A set of JSPropertyAttributes. Combine multiple attributes by logically ORing them together."]
pub type JSPropertyAttributes = ::std::os::raw::c_uint;
pub const kJSClassAttributeNone: ::std::os::raw::c_uint = 0;
pub const kJSClassAttributeNoAutomaticPrototype: ::std::os::raw::c_uint = 2;
#[doc = "@enum JSClassAttribute"]
#[doc = "@constant kJSClassAttributeNone Specifies that a class has no special attributes."]
#[doc = "@constant kJSClassAttributeNoAutomaticPrototype Specifies that a class should not automatically generate a shared prototype for its instance objects. Use kJSClassAttributeNoAutomaticPrototype in combination with JSObjectSetPrototype to manage prototypes manually."]
pub type _bindgen_ty_2 = ::std::os::raw::c_uint;
#[doc = "@typedef JSClassAttributes"]
#[doc = "@abstract A set of JSClassAttributes. Combine multiple attributes by logically ORing them together."]
pub type JSClassAttributes = ::std::os::raw::c_uint;
#[doc = "@typedef JSObjectInitializeCallback"]
#[doc = "@abstract The callback invoked when an object is first created."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject being created."]
#[doc = "@discussion If you named your function Initialize, you would declare it like this:"]
#[doc = ""]
#[doc = "void Initialize(JSContextRef ctx, JSObjectRef object);"]
#[doc = ""]
#[doc = "Unlike the other object callbacks, the initialize callback is called on the least"]
#[doc = "derived class (the parent class) first, and the most derived class last."]
pub type JSObjectInitializeCallback =
::std::option::Option<unsafe extern "C" fn(ctx: JSContextRef, object: JSObjectRef)>;
pub type JSObjectInitializeCallbackEx = ::std::option::Option<
unsafe extern "C" fn(ctx: JSContextRef, jsClass: JSClassRef, object: JSObjectRef),
>;
#[doc = "@typedef JSObjectFinalizeCallback"]
#[doc = "@abstract The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread."]
#[doc = "@param object The JSObject being finalized."]
#[doc = "@discussion If you named your function Finalize, you would declare it like this:"]
#[doc = ""]
#[doc = "void Finalize(JSObjectRef object);"]
#[doc = ""]
#[doc = "The finalize callback is called on the most derived class first, and the least"]
#[doc = "derived class (the parent class) last."]
#[doc = ""]
#[doc = "You must not call any function that may cause a garbage collection or an allocation"]
#[doc = "of a garbage collected object from within a JSObjectFinalizeCallback. This includes"]
#[doc = "all functions that have a JSContextRef parameter."]
pub type JSObjectFinalizeCallback =
::std::option::Option<unsafe extern "C" fn(object: JSObjectRef)>;
pub type JSObjectFinalizeCallbackEx =
::std::option::Option<unsafe extern "C" fn(jsClass: JSClassRef, object: JSObjectRef)>;
#[doc = "@typedef JSObjectHasPropertyCallback"]
#[doc = "@abstract The callback invoked when determining whether an object has a property."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to search for the property."]
#[doc = "@param propertyName A JSString containing the name of the property look up."]
#[doc = "@result true if object has the property, otherwise false."]
#[doc = "@discussion If you named your function HasProperty, you would declare it like this:"]
#[doc = ""]
#[doc = "bool HasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName);"]
#[doc = ""]
#[doc = "If this function returns false, the hasProperty request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain."]
#[doc = ""]
#[doc = "This callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value would be expensive."]
#[doc = ""]
#[doc = "If this callback is NULL, the getProperty callback will be used to service hasProperty requests."]
pub type JSObjectHasPropertyCallback = ::std::option::Option<
unsafe extern "C" fn(ctx: JSContextRef, object: JSObjectRef, propertyName: JSStringRef) -> bool,
>;
pub type JSObjectHasPropertyCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
propertyName: JSStringRef,
) -> bool,
>;
#[doc = "@typedef JSObjectGetPropertyCallback"]
#[doc = "@abstract The callback invoked when getting a property's value."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to search for the property."]
#[doc = "@param propertyName A JSString containing the name of the property to get."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result The property's value if object has the property, otherwise NULL."]
#[doc = "@discussion If you named your function GetProperty, you would declare it like this:"]
#[doc = ""]
#[doc = "JSValueRef GetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);"]
#[doc = ""]
#[doc = "If this function returns NULL, the get request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain."]
pub type JSObjectGetPropertyCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
pub type JSObjectGetPropertyCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
#[doc = "@typedef JSObjectSetPropertyCallback"]
#[doc = "@abstract The callback invoked when setting a property's value."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject on which to set the property's value."]
#[doc = "@param propertyName A JSString containing the name of the property to set."]
#[doc = "@param value A JSValue to use as the property's value."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result true if the property was set, otherwise false."]
#[doc = "@discussion If you named your function SetProperty, you would declare it like this:"]
#[doc = ""]
#[doc = "bool SetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception);"]
#[doc = ""]
#[doc = "If this function returns false, the set request forwards to object's statically declared properties, then its parent class chain (which includes the default object class)."]
pub type JSObjectSetPropertyCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> bool,
>;
pub type JSObjectSetPropertyCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
propertyName: JSStringRef,
value: JSValueRef,
exception: *mut JSValueRef,
) -> bool,
>;
#[doc = "@typedef JSObjectDeletePropertyCallback"]
#[doc = "@abstract The callback invoked when deleting a property."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject in which to delete the property."]
#[doc = "@param propertyName A JSString containing the name of the property to delete."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result true if propertyName was successfully deleted, otherwise false."]
#[doc = "@discussion If you named your function DeleteProperty, you would declare it like this:"]
#[doc = ""]
#[doc = "bool DeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);"]
#[doc = ""]
#[doc = "If this function returns false, the delete request forwards to object's statically declared properties, then its parent class chain (which includes the default object class)."]
pub type JSObjectDeletePropertyCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> bool,
>;
pub type JSObjectDeletePropertyCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> bool,
>;
#[doc = "@typedef JSObjectGetPropertyNamesCallback"]
#[doc = "@abstract The callback invoked when collecting the names of an object's properties."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property names are being collected."]
#[doc = "@param propertyNames A JavaScript property name accumulator in which to accumulate the names of object's properties."]
#[doc = "@discussion If you named your function GetPropertyNames, you would declare it like this:"]
#[doc = ""]
#[doc = "void GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);"]
#[doc = ""]
#[doc = "Property name accumulators are used by JSObjectCopyPropertyNames and JavaScript for...in loops."]
#[doc = ""]
#[doc = "Use JSPropertyNameAccumulatorAddName to add property names to accumulator. A class's getPropertyNames callback only needs to provide the names of properties that the class vends through a custom getProperty or setProperty callback. Other properties, including statically declared properties, properties vended by other classes, and properties belonging to object's prototype, are added independently."]
pub type JSObjectGetPropertyNamesCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
object: JSObjectRef,
propertyNames: JSPropertyNameAccumulatorRef,
),
>;
pub type JSObjectGetPropertyNamesCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
propertyNames: JSPropertyNameAccumulatorRef,
),
>;
#[doc = "@typedef JSObjectCallAsFunctionCallback"]
#[doc = "@abstract The callback invoked when an object is called as a function."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param function A JSObject that is the function being called."]
#[doc = "@param thisObject A JSObject that is the 'this' variable in the function's scope."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of the arguments passed to the function."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result A JSValue that is the function's return value."]
#[doc = "@discussion If you named your function CallAsFunction, you would declare it like this:"]
#[doc = ""]
#[doc = "JSValueRef CallAsFunction(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);"]
#[doc = ""]
#[doc = "If your callback were invoked by the JavaScript expression 'myObject.myFunction()', function would be set to myFunction, and thisObject would be set to myObject."]
#[doc = ""]
#[doc = "If this callback is NULL, calling your object as a function will throw an exception."]
pub type JSObjectCallAsFunctionCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
function: JSObjectRef,
thisObject: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
pub type JSObjectCallAsFunctionCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
className: JSStringRef,
function: JSObjectRef,
thisObject: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
#[doc = "@typedef JSObjectCallAsConstructorCallback"]
#[doc = "@abstract The callback invoked when an object is used as a constructor in a 'new' expression."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param constructor A JSObject that is the constructor being called."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of the arguments passed to the function."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result A JSObject that is the constructor's return value."]
#[doc = "@discussion If you named your function CallAsConstructor, you would declare it like this:"]
#[doc = ""]
#[doc = "JSObjectRef CallAsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);"]
#[doc = ""]
#[doc = "If your callback were invoked by the JavaScript expression 'new myConstructor()', constructor would be set to myConstructor."]
#[doc = ""]
#[doc = "If this callback is NULL, using your object as a constructor in a 'new' expression will throw an exception."]
pub type JSObjectCallAsConstructorCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
constructor: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef,
>;
pub type JSObjectCallAsConstructorCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
constructor: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef,
>;
#[doc = "@typedef JSObjectHasInstanceCallback"]
#[doc = "@abstract hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param constructor The JSObject that is the target of the 'instanceof' expression."]
#[doc = "@param possibleInstance The JSValue being tested to determine if it is an instance of constructor."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result true if possibleInstance is an instance of constructor, otherwise false."]
#[doc = "@discussion If you named your function HasInstance, you would declare it like this:"]
#[doc = ""]
#[doc = "bool HasInstance(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);"]
#[doc = ""]
#[doc = "If your callback were invoked by the JavaScript expression 'someValue instanceof myObject', constructor would be set to myObject and possibleInstance would be set to someValue."]
#[doc = ""]
#[doc = "If this callback is NULL, 'instanceof' expressions that target your object will return false."]
#[doc = ""]
#[doc = "Standard JavaScript practice calls for objects that implement the callAsConstructor callback to implement the hasInstance callback as well."]
pub type JSObjectHasInstanceCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
constructor: JSObjectRef,
possibleInstance: JSValueRef,
exception: *mut JSValueRef,
) -> bool,
>;
pub type JSObjectHasInstanceCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
constructor: JSObjectRef,
possibleInstance: JSValueRef,
exception: *mut JSValueRef,
) -> bool,
>;
#[doc = "@typedef JSObjectConvertToTypeCallback"]
#[doc = "@abstract The callback invoked when converting an object to a particular JavaScript type."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to convert."]
#[doc = "@param type A JSType specifying the JavaScript type to convert to."]
#[doc = "@param exception A pointer to a JSValueRef in which to return an exception, if any."]
#[doc = "@result The objects's converted value, or NULL if the object was not converted."]
#[doc = "@discussion If you named your function ConvertToType, you would declare it like this:"]
#[doc = ""]
#[doc = "JSValueRef ConvertToType(JSContextRef ctx, JSObjectRef object, JSType type, JSValueRef* exception);"]
#[doc = ""]
#[doc = "If this function returns false, the conversion request forwards to object's parent class chain (which includes the default object class)."]
#[doc = ""]
#[doc = "This function is only invoked when converting an object to number or string. An object converted to boolean is 'true.' An object converted to object is itself."]
pub type JSObjectConvertToTypeCallback = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
object: JSObjectRef,
type_: JSType,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
pub type JSObjectConvertToTypeCallbackEx = ::std::option::Option<
unsafe extern "C" fn(
ctx: JSContextRef,
jsClass: JSClassRef,
object: JSObjectRef,
type_: JSType,
exception: *mut JSValueRef,
) -> JSValueRef,
>;
#[doc = "@struct JSStaticValue"]
#[doc = "@abstract This structure describes a statically declared value property."]
#[doc = "@field name A null-terminated UTF8 string containing the property's name."]
#[doc = "@field getProperty A JSObjectGetPropertyCallback to invoke when getting the property's value."]
#[doc = "@field setProperty A JSObjectSetPropertyCallback to invoke when setting the property's value. May be NULL if the ReadOnly attribute is set."]
#[doc = "@field attributes A logically ORed set of JSPropertyAttributes to give to the property."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSStaticValue {
pub name: *const ::std::os::raw::c_char,
pub getProperty: JSObjectGetPropertyCallback,
pub setProperty: JSObjectSetPropertyCallback,
pub attributes: JSPropertyAttributes,
}
#[test]
fn bindgen_test_layout_JSStaticValue() {
assert_eq!(
::std::mem::size_of::<JSStaticValue>(),
32usize,
concat!("Size of: ", stringify!(JSStaticValue))
);
assert_eq!(
::std::mem::align_of::<JSStaticValue>(),
8usize,
concat!("Alignment of ", stringify!(JSStaticValue))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValue>())).name as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValue),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValue>())).getProperty as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValue),
"::",
stringify!(getProperty)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValue>())).setProperty as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValue),
"::",
stringify!(setProperty)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValue>())).attributes as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValue),
"::",
stringify!(attributes)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSStaticValueEx {
pub name: *const ::std::os::raw::c_char,
pub getPropertyEx: JSObjectGetPropertyCallbackEx,
pub setPropertyEx: JSObjectSetPropertyCallbackEx,
pub attributes: JSPropertyAttributes,
}
#[test]
fn bindgen_test_layout_JSStaticValueEx() {
assert_eq!(
::std::mem::size_of::<JSStaticValueEx>(),
32usize,
concat!("Size of: ", stringify!(JSStaticValueEx))
);
assert_eq!(
::std::mem::align_of::<JSStaticValueEx>(),
8usize,
concat!("Alignment of ", stringify!(JSStaticValueEx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValueEx>())).name as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValueEx),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValueEx>())).getPropertyEx as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValueEx),
"::",
stringify!(getPropertyEx)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValueEx>())).setPropertyEx as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValueEx),
"::",
stringify!(setPropertyEx)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticValueEx>())).attributes as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(JSStaticValueEx),
"::",
stringify!(attributes)
)
);
}
#[doc = "@struct JSStaticFunction"]
#[doc = "@abstract This structure describes a statically declared function property."]
#[doc = "@field name A null-terminated UTF8 string containing the property's name."]
#[doc = "@field callAsFunction A JSObjectCallAsFunctionCallback to invoke when the property is called as a function."]
#[doc = "@field attributes A logically ORed set of JSPropertyAttributes to give to the property."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSStaticFunction {
pub name: *const ::std::os::raw::c_char,
pub callAsFunction: JSObjectCallAsFunctionCallback,
pub attributes: JSPropertyAttributes,
}
#[test]
fn bindgen_test_layout_JSStaticFunction() {
assert_eq!(
::std::mem::size_of::<JSStaticFunction>(),
24usize,
concat!("Size of: ", stringify!(JSStaticFunction))
);
assert_eq!(
::std::mem::align_of::<JSStaticFunction>(),
8usize,
concat!("Alignment of ", stringify!(JSStaticFunction))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticFunction>())).name as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunction),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticFunction>())).callAsFunction as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunction),
"::",
stringify!(callAsFunction)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticFunction>())).attributes as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunction),
"::",
stringify!(attributes)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSStaticFunctionEx {
pub name: *const ::std::os::raw::c_char,
pub callAsFunctionEx: JSObjectCallAsFunctionCallbackEx,
pub attributes: JSPropertyAttributes,
}
#[test]
fn bindgen_test_layout_JSStaticFunctionEx() {
assert_eq!(
::std::mem::size_of::<JSStaticFunctionEx>(),
24usize,
concat!("Size of: ", stringify!(JSStaticFunctionEx))
);
assert_eq!(
::std::mem::align_of::<JSStaticFunctionEx>(),
8usize,
concat!("Alignment of ", stringify!(JSStaticFunctionEx))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticFunctionEx>())).name as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunctionEx),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSStaticFunctionEx>())).callAsFunctionEx as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunctionEx),
"::",
stringify!(callAsFunctionEx)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSStaticFunctionEx>())).attributes as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JSStaticFunctionEx),
"::",
stringify!(attributes)
)
);
}
#[doc = "@struct JSClassDefinition"]
#[doc = "@abstract This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL."]
#[doc = "@field version The version number of this structure. The current version is 0."]
#[doc = "@field attributes A logically ORed set of JSClassAttributes to give to the class."]
#[doc = "@field className A null-terminated UTF8 string containing the class's name."]
#[doc = "@field parentClass A JSClass to set as the class's parent class. Pass NULL use the default object class."]
#[doc = "@field staticValues A JSStaticValue array containing the class's statically declared value properties. Pass NULL to specify no statically declared value properties. The array must be terminated by a JSStaticValue whose name field is NULL."]
#[doc = "@field staticFunctions A JSStaticFunction array containing the class's statically declared function properties. Pass NULL to specify no statically declared function properties. The array must be terminated by a JSStaticFunction whose name field is NULL."]
#[doc = "@field initialize The callback invoked when an object is first created. Use this callback to initialize the object."]
#[doc = "@field finalize The callback invoked when an object is finalized (prepared for garbage collection). Use this callback to release resources allocated for the object, and perform other cleanup."]
#[doc = "@field hasProperty The callback invoked when determining whether an object has a property. If this field is NULL, getProperty is called instead. The hasProperty callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value is expensive."]
#[doc = "@field getProperty The callback invoked when getting a property's value."]
#[doc = "@field setProperty The callback invoked when setting a property's value."]
#[doc = "@field deleteProperty The callback invoked when deleting a property."]
#[doc = "@field getPropertyNames The callback invoked when collecting the names of an object's properties."]
#[doc = "@field callAsFunction The callback invoked when an object is called as a function."]
#[doc = "@field hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression."]
#[doc = "@field callAsConstructor The callback invoked when an object is used as a constructor in a 'new' expression."]
#[doc = "@field convertToType The callback invoked when converting an object to a particular JavaScript type."]
#[doc = "@discussion The staticValues and staticFunctions arrays are the simplest and most efficient means for vending custom properties. Statically declared properties autmatically service requests like getProperty, setProperty, and getPropertyNames. Property access callbacks are required only to implement unusual properties, like array indexes, whose names are not known at compile-time."]
#[doc = ""]
#[doc = "If you named your getter function \"GetX\" and your setter function \"SetX\", you would declare a JSStaticValue array containing \"X\" like this:"]
#[doc = ""]
#[doc = "JSStaticValue StaticValueArray[] = {"]
#[doc = "{ \"X\", GetX, SetX, kJSPropertyAttributeNone },"]
#[doc = "{ 0, 0, 0, 0 }"]
#[doc = "};"]
#[doc = ""]
#[doc = "Standard JavaScript practice calls for storing function objects in prototypes, so they can be shared. The default JSClass created by JSClassCreate follows this idiom, instantiating objects with a shared, automatically generating prototype containing the class's function objects. The kJSClassAttributeNoAutomaticPrototype attribute specifies that a JSClass should not automatically generate such a prototype. The resulting JSClass instantiates objects with the default object prototype, and gives each instance object its own copy of the class's function objects."]
#[doc = ""]
#[doc = "A NULL callback specifies that the default object callback should substitute, except in the case of hasProperty, where it specifies that getProperty should substitute."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct JSClassDefinition {
pub version: ::std::os::raw::c_int,
pub attributes: JSClassAttributes,
pub className: *const ::std::os::raw::c_char,
pub parentClass: JSClassRef,
pub __bindgen_anon_1: JSClassDefinition__bindgen_ty_1,
pub privateData: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union JSClassDefinition__bindgen_ty_1 {
pub __bindgen_anon_1: JSClassDefinition__bindgen_ty_1__bindgen_ty_1,
pub __bindgen_anon_2: JSClassDefinition__bindgen_ty_1__bindgen_ty_2,
_bindgen_union_align: [u64; 13usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSClassDefinition__bindgen_ty_1__bindgen_ty_1 {
pub staticValues: *const JSStaticValue,
pub staticFunctions: *const JSStaticFunction,
pub initialize: JSObjectInitializeCallback,
pub finalize: JSObjectFinalizeCallback,
pub hasProperty: JSObjectHasPropertyCallback,
pub getProperty: JSObjectGetPropertyCallback,
pub setProperty: JSObjectSetPropertyCallback,
pub deleteProperty: JSObjectDeletePropertyCallback,
pub getPropertyNames: JSObjectGetPropertyNamesCallback,
pub callAsFunction: JSObjectCallAsFunctionCallback,
pub callAsConstructor: JSObjectCallAsConstructorCallback,
pub hasInstance: JSObjectHasInstanceCallback,
pub convertToType: JSObjectConvertToTypeCallback,
}
#[test]
fn bindgen_test_layout_JSClassDefinition__bindgen_ty_1__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>(),
104usize,
concat!(
"Size of: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1)
)
);
assert_eq!(
::std::mem::align_of::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>(),
8usize,
concat!(
"Alignment of ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).staticValues
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(staticValues)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>()))
.staticFunctions as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(staticFunctions)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).initialize
as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(initialize)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).finalize
as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(finalize)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).hasProperty
as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(hasProperty)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).getProperty
as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(getProperty)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).setProperty
as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(setProperty)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).deleteProperty
as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(deleteProperty)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>()))
.getPropertyNames as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(getPropertyNames)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).callAsFunction
as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(callAsFunction)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>()))
.callAsConstructor as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(callAsConstructor)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).hasInstance
as *const _ as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(hasInstance)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_1>())).convertToType
as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_1),
"::",
stringify!(convertToType)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct JSClassDefinition__bindgen_ty_1__bindgen_ty_2 {
pub staticValuesEx: *const JSStaticValueEx,
pub staticFunctionsEx: *const JSStaticFunctionEx,
pub initializeEx: JSObjectInitializeCallbackEx,
pub finalizeEx: JSObjectFinalizeCallbackEx,
pub hasPropertyEx: JSObjectHasPropertyCallbackEx,
pub getPropertyEx: JSObjectGetPropertyCallbackEx,
pub setPropertyEx: JSObjectSetPropertyCallbackEx,
pub deletePropertyEx: JSObjectDeletePropertyCallbackEx,
pub getPropertyNamesEx: JSObjectGetPropertyNamesCallbackEx,
pub callAsFunctionEx: JSObjectCallAsFunctionCallbackEx,
pub callAsConstructorEx: JSObjectCallAsConstructorCallbackEx,
pub hasInstanceEx: JSObjectHasInstanceCallbackEx,
pub convertToTypeEx: JSObjectConvertToTypeCallbackEx,
}
#[test]
fn bindgen_test_layout_JSClassDefinition__bindgen_ty_1__bindgen_ty_2() {
assert_eq!(
::std::mem::size_of::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>(),
104usize,
concat!(
"Size of: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2)
)
);
assert_eq!(
::std::mem::align_of::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>(),
8usize,
concat!(
"Alignment of ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).staticValuesEx
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(staticValuesEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.staticFunctionsEx as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(staticFunctionsEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).initializeEx
as *const _ as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(initializeEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).finalizeEx
as *const _ as usize
},
24usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(finalizeEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).hasPropertyEx
as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(hasPropertyEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).getPropertyEx
as *const _ as usize
},
40usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(getPropertyEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).setPropertyEx
as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(setPropertyEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.deletePropertyEx as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(deletePropertyEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.getPropertyNamesEx as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(getPropertyNamesEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.callAsFunctionEx as *const _ as usize
},
72usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(callAsFunctionEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.callAsConstructorEx as *const _ as usize
},
80usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(callAsConstructorEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>())).hasInstanceEx
as *const _ as usize
},
88usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(hasInstanceEx)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<JSClassDefinition__bindgen_ty_1__bindgen_ty_2>()))
.convertToTypeEx as *const _ as usize
},
96usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition__bindgen_ty_1__bindgen_ty_2),
"::",
stringify!(convertToTypeEx)
)
);
}
#[test]
fn bindgen_test_layout_JSClassDefinition__bindgen_ty_1() {
assert_eq!(
::std::mem::size_of::<JSClassDefinition__bindgen_ty_1>(),
104usize,
concat!("Size of: ", stringify!(JSClassDefinition__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<JSClassDefinition__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(JSClassDefinition__bindgen_ty_1))
);
}
impl ::std::fmt::Debug for JSClassDefinition__bindgen_ty_1 {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
write!(f, "JSClassDefinition__bindgen_ty_1 {{ union }}")
}
}
#[test]
fn bindgen_test_layout_JSClassDefinition() {
assert_eq!(
::std::mem::size_of::<JSClassDefinition>(),
136usize,
concat!("Size of: ", stringify!(JSClassDefinition))
);
assert_eq!(
::std::mem::align_of::<JSClassDefinition>(),
8usize,
concat!("Alignment of ", stringify!(JSClassDefinition))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSClassDefinition>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSClassDefinition>())).attributes as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition),
"::",
stringify!(attributes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSClassDefinition>())).className as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition),
"::",
stringify!(className)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSClassDefinition>())).parentClass as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition),
"::",
stringify!(parentClass)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<JSClassDefinition>())).privateData as *const _ as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(JSClassDefinition),
"::",
stringify!(privateData)
)
);
}
impl ::std::fmt::Debug for JSClassDefinition {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
write ! (f , "JSClassDefinition {{ version: {:?}, attributes: {:?}, className: {:?}, parentClass: {:?}, __bindgen_anon_1: {:?}, privateData: {:?} }}" , self . version , self . attributes , self . className , self . parentClass , self . __bindgen_anon_1 , self . privateData)
}
}
extern "C" {
pub static kJSClassDefinitionEmpty: JSClassDefinition;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript class suitable for use with JSObjectMake."]
#[doc = "@param definition A JSClassDefinition that defines the class."]
#[doc = "@result A JSClass with the given definition. Ownership follows the Create Rule."]
pub fn JSClassCreate(definition: *const JSClassDefinition) -> JSClassRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retains a JavaScript class."]
#[doc = "@param jsClass The JSClass to retain."]
#[doc = "@result A JSClass that is the same as jsClass."]
pub fn JSClassRetain(jsClass: JSClassRef) -> JSClassRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Releases a JavaScript class."]
#[doc = "@param jsClass The JSClass to release."]
pub fn JSClassRelease(jsClass: JSClassRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retrieves the private data from a class reference, only possible with classes created with version 1000 (extended callbacks)."]
#[doc = "@param jsClass The class to get the data from"]
#[doc = "@result The private data on the class, or NULL, if not set"]
#[doc = "@discussion Only classes with version 1000 (extended callbacks) can store private data, for other classes always NULL will always be returned."]
pub fn JSClassGetPrivate(jsClass: JSClassRef) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets the private data on a class, only possible with classes created with version 1000 (extended callbacks)."]
#[doc = "@param jsClass The class to set the data on"]
#[doc = "@param data A void* to set as the private data for the class"]
#[doc = "@result true if the data has been set on the class, false if the class has not been created with version 1000 (extended callbacks)"]
#[doc = "@discussion Only classes with version 1000 (extended callbacks) can store private data, for other classes the function always fails. The set pointer is not touched by the engine."]
pub fn JSClassSetPrivate(jsClass: JSClassRef, data: *mut ::std::os::raw::c_void) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param jsClass The JSClass to assign to the object. Pass NULL to use the default object class."]
#[doc = "@param data A void* to set as the object's private data. Pass NULL to specify no private data."]
#[doc = "@result A JSObject with the given class and private data."]
#[doc = "@discussion The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data."]
#[doc = ""]
#[doc = "data is set on the created object before the intialize methods in its class chain are called. This enables the initialize methods to retrieve and manipulate data through JSObjectGetPrivate."]
pub fn JSObjectMake(
ctx: JSContextRef,
jsClass: JSClassRef,
data: *mut ::std::os::raw::c_void,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Convenience method for creating a JavaScript function with a given callback as its implementation."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function."]
#[doc = "@param callAsFunction The JSObjectCallAsFunctionCallback to invoke when the function is called."]
#[doc = "@result A JSObject that is a function. The object's prototype will be the default function prototype."]
pub fn JSObjectMakeFunctionWithCallback(
ctx: JSContextRef,
name: JSStringRef,
callAsFunction: JSObjectCallAsFunctionCallback,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Convenience method for creating a JavaScript constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param jsClass A JSClass that is the class your constructor will assign to the objects its constructs. jsClass will be used to set the constructor's .prototype property, and to evaluate 'instanceof' expressions. Pass NULL to use the default object class."]
#[doc = "@param callAsConstructor A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor."]
#[doc = "@result A JSObject that is a constructor. The object's prototype will be the default object prototype."]
#[doc = "@discussion The default object constructor takes no arguments and constructs an object of class jsClass with no private data."]
pub fn JSObjectMakeConstructor(
ctx: JSContextRef,
jsClass: JSClassRef,
callAsConstructor: JSObjectCallAsConstructorCallback,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObject that is an Array."]
#[doc = "@discussion The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument"]
#[doc = "is supplied, this function returns an array with one element."]
pub fn JSObjectMakeArray(
ctx: JSContextRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Date object, as if by invoking the built-in Date constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of arguments to pass to the Date Constructor. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObject that is a Date."]
pub fn JSObjectMakeDate(
ctx: JSContextRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Error object, as if by invoking the built-in Error constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of arguments to pass to the Error Constructor. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObject that is a Error."]
pub fn JSObjectMakeError(
ctx: JSContextRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of arguments to pass to the RegExp Constructor. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObject that is a RegExp."]
pub fn JSObjectMakeRegExp(
ctx: JSContextRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript promise object by invoking the provided executor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param resolve A pointer to a JSObjectRef in which to store the resolve function for the new promise. Pass NULL if you do not care to store the resolve callback."]
#[doc = "@param reject A pointer to a JSObjectRef in which to store the reject function for the new promise. Pass NULL if you do not care to store the reject callback."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObject that is a promise or NULL if an exception occurred."]
pub fn JSObjectMakeDeferredPromise(
ctx: JSContextRef,
resolve: *mut JSObjectRef,
reject: *mut JSObjectRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a function with a given script as its body."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function."]
#[doc = "@param parameterCount An integer count of the number of parameter names in parameterNames."]
#[doc = "@param parameterNames A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0."]
#[doc = "@param body A JSString containing the script to use as the function's body."]
#[doc = "@param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions."]
#[doc = "@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1."]
#[doc = "@param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception."]
#[doc = "@result A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype."]
#[doc = "@discussion Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution."]
pub fn JSObjectMakeFunction(
ctx: JSContextRef,
name: JSStringRef,
parameterCount: ::std::os::raw::c_uint,
parameterNames: *const JSStringRef,
body: JSStringRef,
sourceURL: JSStringRef,
startingLineNumber: ::std::os::raw::c_int,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets an object's prototype."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object A JSObject whose prototype you want to get."]
#[doc = "@result A JSValue that is the object's prototype."]
pub fn JSObjectGetPrototype(ctx: JSContextRef, object: JSObjectRef) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets an object's prototype."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose prototype you want to set."]
#[doc = "@param value A JSValue to set as the object's prototype."]
pub fn JSObjectSetPrototype(ctx: JSContextRef, object: JSObjectRef, value: JSValueRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether an object has a given property."]
#[doc = "@param object The JSObject to test."]
#[doc = "@param propertyName A JSString containing the property's name."]
#[doc = "@result true if the object has a property whose name matches propertyName, otherwise false."]
pub fn JSObjectHasProperty(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a property from an object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to get."]
#[doc = "@param propertyName A JSString containing the property's name."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The property's value if object has the property, otherwise the undefined value."]
pub fn JSObjectGetProperty(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets a property on an object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to set."]
#[doc = "@param propertyName A JSString containing the property's name."]
#[doc = "@param value A JSValueRef to use as the property's value."]
#[doc = "@param attributes A logically ORed set of JSPropertyAttributes to give to the property."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
pub fn JSObjectSetProperty(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
value: JSValueRef,
attributes: JSPropertyAttributes,
exception: *mut JSValueRef,
);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Deletes a property from an object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to delete."]
#[doc = "@param propertyName A JSString containing the property's name."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set)."]
pub fn JSObjectDeleteProperty(
ctx: JSContextRef,
object: JSObjectRef,
propertyName: JSStringRef,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether an object has a given property using a JSValueRef as the property key."]
#[doc = "@param object The JSObject to test."]
#[doc = "@param propertyKey A JSValueRef containing the property key to use when looking up the property."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result true if the object has a property whose name matches propertyKey, otherwise false."]
#[doc = "@discussion This function is the same as performing \"propertyKey in object\" from JavaScript."]
pub fn JSObjectHasPropertyForKey(
ctx: JSContextRef,
object: JSObjectRef,
propertyKey: JSValueRef,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a property from an object using a JSValueRef as the property key."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to get."]
#[doc = "@param propertyKey A JSValueRef containing the property key to use when looking up the property."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The property's value if object has the property key, otherwise the undefined value."]
#[doc = "@discussion This function is the same as performing \"object[propertyKey]\" from JavaScript."]
pub fn JSObjectGetPropertyForKey(
ctx: JSContextRef,
object: JSObjectRef,
propertyKey: JSValueRef,
exception: *mut JSValueRef,
) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets a property on an object using a JSValueRef as the property key."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to set."]
#[doc = "@param propertyKey A JSValueRef containing the property key to use when looking up the property."]
#[doc = "@param value A JSValueRef to use as the property's value."]
#[doc = "@param attributes A logically ORed set of JSPropertyAttributes to give to the property."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@discussion This function is the same as performing \"object[propertyKey] = value\" from JavaScript."]
pub fn JSObjectSetPropertyForKey(
ctx: JSContextRef,
object: JSObjectRef,
propertyKey: JSValueRef,
value: JSValueRef,
attributes: JSPropertyAttributes,
exception: *mut JSValueRef,
);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Deletes a property from an object using a JSValueRef as the property key."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to delete."]
#[doc = "@param propertyKey A JSValueRef containing the property key to use when looking up the property."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set)."]
#[doc = "@discussion This function is the same as performing \"delete object[propertyKey]\" from JavaScript."]
pub fn JSObjectDeletePropertyForKey(
ctx: JSContextRef,
object: JSObjectRef,
propertyKey: JSValueRef,
exception: *mut JSValueRef,
) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a property from an object by numeric index."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to get."]
#[doc = "@param propertyIndex An integer value that is the property's name."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The property's value if object has the property, otherwise the undefined value."]
#[doc = "@discussion Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but JSObjectGetPropertyAtIndex provides optimized access to numeric properties."]
pub fn JSObjectGetPropertyAtIndex(
ctx: JSContextRef,
object: JSObjectRef,
propertyIndex: ::std::os::raw::c_uint,
exception: *mut JSValueRef,
) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets a property on an object by numeric index."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject whose property you want to set."]
#[doc = "@param propertyIndex The property's name as a number."]
#[doc = "@param value A JSValue to use as the property's value."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@discussion Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but JSObjectSetPropertyAtIndex provides optimized access to numeric properties."]
pub fn JSObjectSetPropertyAtIndex(
ctx: JSContextRef,
object: JSObjectRef,
propertyIndex: ::std::os::raw::c_uint,
value: JSValueRef,
exception: *mut JSValueRef,
);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets an object's private data."]
#[doc = "@param object A JSObject whose private data you want to get."]
#[doc = "@result A void* that is the object's private data, if the object has private data, otherwise NULL."]
pub fn JSObjectGetPrivate(object: JSObjectRef) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets a pointer to private data on an object."]
#[doc = "@param object The JSObject whose private data you want to set."]
#[doc = "@param data A void* to set as the object's private data."]
#[doc = "@result true if object can store private data, otherwise false."]
#[doc = "@discussion The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data."]
pub fn JSObjectSetPrivate(object: JSObjectRef, data: *mut ::std::os::raw::c_void) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether an object can be called as a function."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to test."]
#[doc = "@result true if the object can be called as a function, otherwise false."]
pub fn JSObjectIsFunction(ctx: JSContextRef, object: JSObjectRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Calls an object as a function."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to call as a function."]
#[doc = "@param thisObject The object to use as \"this,\" or NULL to use the global object as \"this.\""]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of arguments to pass to the function. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function."]
pub fn JSObjectCallAsFunction(
ctx: JSContextRef,
object: JSObjectRef,
thisObject: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSValueRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether an object can be called as a constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to test."]
#[doc = "@result true if the object can be called as a constructor, otherwise false."]
pub fn JSObjectIsConstructor(ctx: JSContextRef, object: JSObjectRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Calls an object as a constructor."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObject to call as a constructor."]
#[doc = "@param argumentCount An integer count of the number of arguments in arguments."]
#[doc = "@param arguments A JSValue array of arguments to pass to the constructor. Pass NULL if argumentCount is 0."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor."]
pub fn JSObjectCallAsConstructor(
ctx: JSContextRef,
object: JSObjectRef,
argumentCount: size_t,
arguments: *const JSValueRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets the names of an object's enumerable properties."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The object whose property names you want to get."]
#[doc = "@result A JSPropertyNameArray containing the names object's enumerable properties. Ownership follows the Create Rule."]
pub fn JSObjectCopyPropertyNames(
ctx: JSContextRef,
object: JSObjectRef,
) -> JSPropertyNameArrayRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retains a JavaScript property name array."]
#[doc = "@param array The JSPropertyNameArray to retain."]
#[doc = "@result A JSPropertyNameArray that is the same as array."]
pub fn JSPropertyNameArrayRetain(array: JSPropertyNameArrayRef) -> JSPropertyNameArrayRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Releases a JavaScript property name array."]
#[doc = "@param array The JSPropetyNameArray to release."]
pub fn JSPropertyNameArrayRelease(array: JSPropertyNameArrayRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a count of the number of items in a JavaScript property name array."]
#[doc = "@param array The array from which to retrieve the count."]
#[doc = "@result An integer count of the number of names in array."]
pub fn JSPropertyNameArrayGetCount(array: JSPropertyNameArrayRef) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a property name at a given index in a JavaScript property name array."]
#[doc = "@param array The array from which to retrieve the property name."]
#[doc = "@param index The index of the property name to retrieve."]
#[doc = "@result A JSStringRef containing the property name."]
pub fn JSPropertyNameArrayGetNameAtIndex(
array: JSPropertyNameArrayRef,
index: size_t,
) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Adds a property name to a JavaScript property name accumulator."]
#[doc = "@param accumulator The accumulator object to which to add the property name."]
#[doc = "@param propertyName The property name to add."]
pub fn JSPropertyNameAccumulatorAddName(
accumulator: JSPropertyNameAccumulatorRef,
propertyName: JSStringRef,
);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript context group."]
#[doc = "@discussion A JSContextGroup associates JavaScript contexts with one another."]
#[doc = "Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging"]
#[doc = "JavaScript objects between contexts in different groups will produce undefined behavior."]
#[doc = "When objects from the same context group are used in multiple threads, explicit"]
#[doc = "synchronization is required."]
#[doc = ""]
#[doc = "A JSContextGroup may need to run deferred tasks on a run loop, such as garbage collection"]
#[doc = "or resolving WebAssembly compilations. By default, calling JSContextGroupCreate will use"]
#[doc = "the run loop of the thread it was called on. Currently, there is no API to change a"]
#[doc = "JSContextGroup's run loop once it has been created."]
#[doc = "@result The created JSContextGroup."]
pub fn JSContextGroupCreate() -> JSContextGroupRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retains a JavaScript context group."]
#[doc = "@param group The JSContextGroup to retain."]
#[doc = "@result A JSContextGroup that is the same as group."]
pub fn JSContextGroupRetain(group: JSContextGroupRef) -> JSContextGroupRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Releases a JavaScript context group."]
#[doc = "@param group The JSContextGroup to release."]
pub fn JSContextGroupRelease(group: JSContextGroupRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a global JavaScript execution context."]
#[doc = "@discussion JSGlobalContextCreate allocates a global object and populates it with all the"]
#[doc = "built-in JavaScript objects, such as Object, Function, String, and Array."]
#[doc = ""]
#[doc = "In WebKit version 4.0 and later, the context is created in a unique context group."]
#[doc = "Therefore, scripts may execute in it concurrently with scripts executing in other contexts."]
#[doc = "However, you may not use values created in the context in other contexts."]
#[doc = "@param globalObjectClass The class to use when creating the global object. Pass"]
#[doc = "NULL to use the default object class."]
#[doc = "@result A JSGlobalContext with a global object of class globalObjectClass."]
pub fn JSGlobalContextCreate(globalObjectClass: JSClassRef) -> JSGlobalContextRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a global JavaScript execution context in the context group provided."]
#[doc = "@discussion JSGlobalContextCreateInGroup allocates a global object and populates it with"]
#[doc = "all the built-in JavaScript objects, such as Object, Function, String, and Array."]
#[doc = "@param globalObjectClass The class to use when creating the global object. Pass"]
#[doc = "NULL to use the default object class."]
#[doc = "@param group The context group to use. The created global context retains the group."]
#[doc = "Pass NULL to create a unique group for the context."]
#[doc = "@result A JSGlobalContext with a global object of class globalObjectClass and a context"]
#[doc = "group equal to group."]
pub fn JSGlobalContextCreateInGroup(
group: JSContextGroupRef,
globalObjectClass: JSClassRef,
) -> JSGlobalContextRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retains a global JavaScript execution context."]
#[doc = "@param ctx The JSGlobalContext to retain."]
#[doc = "@result A JSGlobalContext that is the same as ctx."]
pub fn JSGlobalContextRetain(ctx: JSGlobalContextRef) -> JSGlobalContextRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Releases a global JavaScript execution context."]
#[doc = "@param ctx The JSGlobalContext to release."]
pub fn JSGlobalContextRelease(ctx: JSGlobalContextRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets the global object of a JavaScript execution context."]
#[doc = "@param ctx The JSContext whose global object you want to get."]
#[doc = "@result ctx's global object."]
pub fn JSContextGetGlobalObject(ctx: JSContextRef) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets the context group to which a JavaScript execution context belongs."]
#[doc = "@param ctx The JSContext whose group you want to get."]
#[doc = "@result ctx's group."]
pub fn JSContextGetGroup(ctx: JSContextRef) -> JSContextGroupRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets the global context of a JavaScript execution context."]
#[doc = "@param ctx The JSContext whose global context you want to get."]
#[doc = "@result ctx's global context."]
pub fn JSContextGetGlobalContext(ctx: JSContextRef) -> JSGlobalContextRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Gets a copy of the name of a context."]
#[doc = "@param ctx The JSGlobalContext whose name you want to get."]
#[doc = "@result The name for ctx."]
#[doc = "@discussion A JSGlobalContext's name is exposed for remote debugging to make it"]
#[doc = "easier to identify the context you would like to attach to."]
pub fn JSGlobalContextCopyName(ctx: JSGlobalContextRef) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Sets the remote debugging name for a context."]
#[doc = "@param ctx The JSGlobalContext that you want to name."]
#[doc = "@param name The remote debugging name to set on ctx."]
pub fn JSGlobalContextSetName(ctx: JSGlobalContextRef, name: JSStringRef);
}
#[doc = "@typedef JSChar"]
#[doc = "@abstract A UTF-16 code unit. One, or a sequence of two, can encode any Unicode"]
#[doc = "character. As with all scalar types, endianness depends on the underlying"]
#[doc = "architecture."]
pub type JSChar = ::std::os::raw::c_ushort;
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript string from a buffer of Unicode characters."]
#[doc = "@param chars The buffer of Unicode characters to copy into the new JSString."]
#[doc = "@param numChars The number of characters to copy from the buffer pointed to by chars."]
#[doc = "@result A JSString containing chars. Ownership follows the Create Rule."]
pub fn JSStringCreateWithCharacters(chars: *const JSChar, numChars: size_t) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript string from a null-terminated UTF8 string."]
#[doc = "@param string The null-terminated UTF8 string to copy into the new JSString."]
#[doc = "@result A JSString containing string. Ownership follows the Create Rule."]
pub fn JSStringCreateWithUTF8CString(string: *const ::std::os::raw::c_char) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Retains a JavaScript string."]
#[doc = "@param string The JSString to retain."]
#[doc = "@result A JSString that is the same as string."]
pub fn JSStringRetain(string: JSStringRef) -> JSStringRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Releases a JavaScript string."]
#[doc = "@param string The JSString to release."]
pub fn JSStringRelease(string: JSStringRef);
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the number of Unicode characters in a JavaScript string."]
#[doc = "@param string The JSString whose length (in Unicode characters) you want to know."]
#[doc = "@result The number of Unicode characters stored in string."]
pub fn JSStringGetLength(string: JSStringRef) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns a pointer to the Unicode character buffer that"]
#[doc = "serves as the backing store for a JavaScript string."]
#[doc = "@param string The JSString whose backing store you want to access."]
#[doc = "@result A pointer to the Unicode character buffer that serves as string's"]
#[doc = "backing store, which will be deallocated when string is deallocated."]
pub fn JSStringGetCharactersPtr(string: JSStringRef) -> *const JSChar;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the maximum number of bytes a JavaScript string will"]
#[doc = "take up if converted into a null-terminated UTF8 string."]
#[doc = "@param string The JSString whose maximum converted size (in bytes) you"]
#[doc = "want to know."]
#[doc = "@result The maximum number of bytes that could be required to convert string into a"]
#[doc = "null-terminated UTF8 string. The number of bytes that the conversion actually ends"]
#[doc = "up requiring could be less than this, but never more."]
pub fn JSStringGetMaximumUTF8CStringSize(string: JSStringRef) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Converts a JavaScript string into a null-terminated UTF8 string,"]
#[doc = "and copies the result into an external byte buffer."]
#[doc = "@param string The source JSString."]
#[doc = "@param buffer The destination byte buffer into which to copy a null-terminated"]
#[doc = "UTF8 representation of string. On return, buffer contains a UTF8 string"]
#[doc = "representation of string. If bufferSize is too small, buffer will contain only"]
#[doc = "partial results. If buffer is not at least bufferSize bytes in size,"]
#[doc = "behavior is undefined."]
#[doc = "@param bufferSize The size of the external buffer in bytes."]
#[doc = "@result The number of bytes written into buffer (including the null-terminator byte)."]
pub fn JSStringGetUTF8CString(
string: JSStringRef,
buffer: *mut ::std::os::raw::c_char,
bufferSize: size_t,
) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether two JavaScript strings match."]
#[doc = "@param a The first JSString to test."]
#[doc = "@param b The second JSString to test."]
#[doc = "@result true if the two strings match, otherwise false."]
pub fn JSStringIsEqual(a: JSStringRef, b: JSStringRef) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Tests whether a JavaScript string matches a null-terminated UTF8 string."]
#[doc = "@param a The JSString to test."]
#[doc = "@param b The null-terminated UTF8 string to test."]
#[doc = "@result true if the two strings match, otherwise false."]
pub fn JSStringIsEqualToUTF8CString(a: JSStringRef, b: *const ::std::os::raw::c_char) -> bool;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Typed Array object with the given number of elements."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned."]
#[doc = "@param length The number of elements to be in the new Typed Array."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef that is a Typed Array with all elements set to zero or NULL if there was an error."]
pub fn JSObjectMakeTypedArray(
ctx: JSContextRef,
arrayType: JSTypedArrayType,
length: size_t,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Typed Array object from an existing pointer."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned."]
#[doc = "@param bytes A pointer to the byte buffer to be used as the backing store of the Typed Array object."]
#[doc = "@param byteLength The number of bytes pointed to by the parameter bytes."]
#[doc = "@param bytesDeallocator The allocator to use to deallocate the external buffer when the JSTypedArrayData object is deallocated."]
#[doc = "@param deallocatorContext A pointer to pass back to the deallocator."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef Typed Array whose backing store is the same as the one pointed to by bytes or NULL if there was an error."]
#[doc = "@discussion If an exception is thrown during this function the bytesDeallocator will always be called."]
pub fn JSObjectMakeTypedArrayWithBytesNoCopy(
ctx: JSContextRef,
arrayType: JSTypedArrayType,
bytes: *mut ::std::os::raw::c_void,
byteLength: size_t,
bytesDeallocator: JSTypedArrayBytesDeallocator,
deallocatorContext: *mut ::std::os::raw::c_void,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Typed Array object from an existing JavaScript Array Buffer object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned."]
#[doc = "@param buffer An Array Buffer object that should be used as the backing store for the created JavaScript Typed Array object."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef that is a Typed Array or NULL if there was an error. The backing store of the Typed Array will be buffer."]
pub fn JSObjectMakeTypedArrayWithArrayBuffer(
ctx: JSContextRef,
arrayType: JSTypedArrayType,
buffer: JSObjectRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Typed Array object from an existing JavaScript Array Buffer object with the given offset and length."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned."]
#[doc = "@param buffer An Array Buffer object that should be used as the backing store for the created JavaScript Typed Array object."]
#[doc = "@param byteOffset The byte offset for the created Typed Array. byteOffset should aligned with the element size of arrayType."]
#[doc = "@param length The number of elements to include in the Typed Array."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef that is a Typed Array or NULL if there was an error. The backing store of the Typed Array will be buffer."]
pub fn JSObjectMakeTypedArrayWithArrayBufferAndOffset(
ctx: JSContextRef,
arrayType: JSTypedArrayType,
buffer: JSObjectRef,
byteOffset: size_t,
length: size_t,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns a temporary pointer to the backing store of a JavaScript Typed Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The Typed Array object whose backing store pointer to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A pointer to the raw data buffer that serves as object's backing store or NULL if object is not a Typed Array object."]
#[doc = "@discussion The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls."]
pub fn JSObjectGetTypedArrayBytesPtr(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the length of a JavaScript Typed Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The Typed Array object whose length to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The length of the Typed Array object or 0 if the object is not a Typed Array object."]
pub fn JSObjectGetTypedArrayLength(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the byte length of a JavaScript Typed Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The Typed Array object whose byte length to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The byte length of the Typed Array object or 0 if the object is not a Typed Array object."]
pub fn JSObjectGetTypedArrayByteLength(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the byte offset of a JavaScript Typed Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The Typed Array object whose byte offset to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The byte offset of the Typed Array object or 0 if the object is not a Typed Array object."]
pub fn JSObjectGetTypedArrayByteOffset(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> size_t;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the JavaScript Array Buffer object that is used as the backing of a JavaScript Typed Array object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JSObjectRef whose Typed Array type data pointer to obtain."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef with a JSTypedArrayType of kJSTypedArrayTypeArrayBuffer or NULL if object is not a Typed Array."]
pub fn JSObjectGetTypedArrayBuffer(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Creates a JavaScript Array Buffer object from an existing pointer."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param bytes A pointer to the byte buffer to be used as the backing store of the Typed Array object."]
#[doc = "@param byteLength The number of bytes pointed to by the parameter bytes."]
#[doc = "@param bytesDeallocator The allocator to use to deallocate the external buffer when the Typed Array data object is deallocated."]
#[doc = "@param deallocatorContext A pointer to pass back to the deallocator."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A JSObjectRef Array Buffer whose backing store is the same as the one pointed to by bytes or NULL if there was an error."]
#[doc = "@discussion If an exception is thrown during this function the bytesDeallocator will always be called."]
pub fn JSObjectMakeArrayBufferWithBytesNoCopy(
ctx: JSContextRef,
bytes: *mut ::std::os::raw::c_void,
byteLength: size_t,
bytesDeallocator: JSTypedArrayBytesDeallocator,
deallocatorContext: *mut ::std::os::raw::c_void,
exception: *mut JSValueRef,
) -> JSObjectRef;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns a pointer to the data buffer that serves as the backing store for a JavaScript Typed Array object."]
#[doc = "@param object The Array Buffer object whose internal backing store pointer to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result A pointer to the raw data buffer that serves as object's backing store or NULL if object is not an Array Buffer object."]
#[doc = "@discussion The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls."]
pub fn JSObjectGetArrayBufferBytesPtr(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = "@function"]
#[doc = "@abstract Returns the number of bytes in a JavaScript data object."]
#[doc = "@param ctx The execution context to use."]
#[doc = "@param object The JS Arary Buffer object whose length in bytes to return."]
#[doc = "@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception."]
#[doc = "@result The number of bytes stored in the data object."]
pub fn JSObjectGetArrayBufferByteLength(
ctx: JSContextRef,
object: JSObjectRef,
exception: *mut JSValueRef,
) -> size_t;
}
pub type ULChar16 = ::std::os::raw::c_ushort;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Config {
_unused: [u8; 0],
}
pub type ULConfig = *mut C_Config;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Renderer {
_unused: [u8; 0],
}
pub type ULRenderer = *mut C_Renderer;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Session {
_unused: [u8; 0],
}
pub type ULSession = *mut C_Session;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_View {
_unused: [u8; 0],
}
pub type ULView = *mut C_View;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Bitmap {
_unused: [u8; 0],
}
pub type ULBitmap = *mut C_Bitmap;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_String {
_unused: [u8; 0],
}
pub type ULString = *mut C_String;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Buffer {
_unused: [u8; 0],
}
pub type ULBuffer = *mut C_Buffer;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_KeyEvent {
_unused: [u8; 0],
}
pub type ULKeyEvent = *mut C_KeyEvent;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_MouseEvent {
_unused: [u8; 0],
}
pub type ULMouseEvent = *mut C_MouseEvent;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_ScrollEvent {
_unused: [u8; 0],
}
pub type ULScrollEvent = *mut C_ScrollEvent;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Surface {
_unused: [u8; 0],
}
pub type ULSurface = *mut C_Surface;
pub type ULBitmapSurface = *mut C_Surface;
pub const ULMessageSource_kMessageSource_XML: ULMessageSource = 0;
pub const ULMessageSource_kMessageSource_JS: ULMessageSource = 1;
pub const ULMessageSource_kMessageSource_Network: ULMessageSource = 2;
pub const ULMessageSource_kMessageSource_ConsoleAPI: ULMessageSource = 3;
pub const ULMessageSource_kMessageSource_Storage: ULMessageSource = 4;
pub const ULMessageSource_kMessageSource_AppCache: ULMessageSource = 5;
pub const ULMessageSource_kMessageSource_Rendering: ULMessageSource = 6;
pub const ULMessageSource_kMessageSource_CSS: ULMessageSource = 7;
pub const ULMessageSource_kMessageSource_Security: ULMessageSource = 8;
pub const ULMessageSource_kMessageSource_ContentBlocker: ULMessageSource = 9;
pub const ULMessageSource_kMessageSource_Other: ULMessageSource = 10;
pub type ULMessageSource = ::std::os::raw::c_uint;
pub const ULMessageLevel_kMessageLevel_Log: ULMessageLevel = 1;
pub const ULMessageLevel_kMessageLevel_Warning: ULMessageLevel = 2;
pub const ULMessageLevel_kMessageLevel_Error: ULMessageLevel = 3;
pub const ULMessageLevel_kMessageLevel_Debug: ULMessageLevel = 4;
pub const ULMessageLevel_kMessageLevel_Info: ULMessageLevel = 5;
pub type ULMessageLevel = ::std::os::raw::c_uint;
pub const ULCursor_kCursor_Pointer: ULCursor = 0;
pub const ULCursor_kCursor_Cross: ULCursor = 1;
pub const ULCursor_kCursor_Hand: ULCursor = 2;
pub const ULCursor_kCursor_IBeam: ULCursor = 3;
pub const ULCursor_kCursor_Wait: ULCursor = 4;
pub const ULCursor_kCursor_Help: ULCursor = 5;
pub const ULCursor_kCursor_EastResize: ULCursor = 6;
pub const ULCursor_kCursor_NorthResize: ULCursor = 7;
pub const ULCursor_kCursor_NorthEastResize: ULCursor = 8;
pub const ULCursor_kCursor_NorthWestResize: ULCursor = 9;
pub const ULCursor_kCursor_SouthResize: ULCursor = 10;
pub const ULCursor_kCursor_SouthEastResize: ULCursor = 11;
pub const ULCursor_kCursor_SouthWestResize: ULCursor = 12;
pub const ULCursor_kCursor_WestResize: ULCursor = 13;
pub const ULCursor_kCursor_NorthSouthResize: ULCursor = 14;
pub const ULCursor_kCursor_EastWestResize: ULCursor = 15;
pub const ULCursor_kCursor_NorthEastSouthWestResize: ULCursor = 16;
pub const ULCursor_kCursor_NorthWestSouthEastResize: ULCursor = 17;
pub const ULCursor_kCursor_ColumnResize: ULCursor = 18;
pub const ULCursor_kCursor_RowResize: ULCursor = 19;
pub const ULCursor_kCursor_MiddlePanning: ULCursor = 20;
pub const ULCursor_kCursor_EastPanning: ULCursor = 21;
pub const ULCursor_kCursor_NorthPanning: ULCursor = 22;
pub const ULCursor_kCursor_NorthEastPanning: ULCursor = 23;
pub const ULCursor_kCursor_NorthWestPanning: ULCursor = 24;
pub const ULCursor_kCursor_SouthPanning: ULCursor = 25;
pub const ULCursor_kCursor_SouthEastPanning: ULCursor = 26;
pub const ULCursor_kCursor_SouthWestPanning: ULCursor = 27;
pub const ULCursor_kCursor_WestPanning: ULCursor = 28;
pub const ULCursor_kCursor_Move: ULCursor = 29;
pub const ULCursor_kCursor_VerticalText: ULCursor = 30;
pub const ULCursor_kCursor_Cell: ULCursor = 31;
pub const ULCursor_kCursor_ContextMenu: ULCursor = 32;
pub const ULCursor_kCursor_Alias: ULCursor = 33;
pub const ULCursor_kCursor_Progress: ULCursor = 34;
pub const ULCursor_kCursor_NoDrop: ULCursor = 35;
pub const ULCursor_kCursor_Copy: ULCursor = 36;
pub const ULCursor_kCursor_None: ULCursor = 37;
pub const ULCursor_kCursor_NotAllowed: ULCursor = 38;
pub const ULCursor_kCursor_ZoomIn: ULCursor = 39;
pub const ULCursor_kCursor_ZoomOut: ULCursor = 40;
pub const ULCursor_kCursor_Grab: ULCursor = 41;
pub const ULCursor_kCursor_Grabbing: ULCursor = 42;
pub const ULCursor_kCursor_Custom: ULCursor = 43;
pub type ULCursor = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Alpha channel only, 8-bits per pixel."]
#[doc = ""]
#[doc = " Encoding: 8-bits per channel, unsigned normalized."]
#[doc = ""]
#[doc = " Color-space: Linear (no gamma), alpha-coverage only."]
#[doc = ""]
pub const ULBitmapFormat_kBitmapFormat_A8_UNORM: ULBitmapFormat = 0;
#[doc = ""]
#[doc = " Blue Green Red Alpha channels, 32-bits per pixel."]
#[doc = ""]
#[doc = " Encoding: 8-bits per channel, unsigned normalized."]
#[doc = ""]
#[doc = " Color-space: sRGB gamma with premultiplied linear alpha channel."]
#[doc = ""]
pub const ULBitmapFormat_kBitmapFormat_BGRA8_UNORM_SRGB: ULBitmapFormat = 1;
pub type ULBitmapFormat = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Key-Down event type. (Does not trigger accelerator commands in WebCore)"]
#[doc = ""]
#[doc = " @NOTE: You should probably use RawKeyDown instead when a physical key"]
#[doc = " is pressed. This member is only here for historic compatibility"]
#[doc = " with WebCore's key event types."]
#[doc = ""]
pub const ULKeyEventType_kKeyEventType_KeyDown: ULKeyEventType = 0;
#[doc = ""]
#[doc = " Key-Up event type. Use this when a physical key is released."]
#[doc = ""]
pub const ULKeyEventType_kKeyEventType_KeyUp: ULKeyEventType = 1;
#[doc = ""]
#[doc = " Raw Key-Down type. Use this when a physical key is pressed."]
#[doc = ""]
#[doc = " @NOTE: You should use RawKeyDown for physical key presses since it"]
#[doc = " allows WebCore to do additional command translation."]
#[doc = ""]
pub const ULKeyEventType_kKeyEventType_RawKeyDown: ULKeyEventType = 2;
#[doc = ""]
#[doc = " Character input event type. Use this when the OS generates text from"]
#[doc = " a physical key being pressed (eg, WM_CHAR on Windows)."]
#[doc = ""]
pub const ULKeyEventType_kKeyEventType_Char: ULKeyEventType = 3;
pub type ULKeyEventType = ::std::os::raw::c_uint;
pub const ULMouseEventType_kMouseEventType_MouseMoved: ULMouseEventType = 0;
pub const ULMouseEventType_kMouseEventType_MouseDown: ULMouseEventType = 1;
pub const ULMouseEventType_kMouseEventType_MouseUp: ULMouseEventType = 2;
pub type ULMouseEventType = ::std::os::raw::c_uint;
pub const ULMouseButton_kMouseButton_None: ULMouseButton = 0;
pub const ULMouseButton_kMouseButton_Left: ULMouseButton = 1;
pub const ULMouseButton_kMouseButton_Middle: ULMouseButton = 2;
pub const ULMouseButton_kMouseButton_Right: ULMouseButton = 3;
pub type ULMouseButton = ::std::os::raw::c_uint;
pub const ULScrollEventType_kScrollEventType_ScrollByPixel: ULScrollEventType = 0;
pub const ULScrollEventType_kScrollEventType_ScrollByPage: ULScrollEventType = 1;
pub type ULScrollEventType = ::std::os::raw::c_uint;
pub const ULFaceWinding_kFaceWinding_Clockwise: ULFaceWinding = 0;
pub const ULFaceWinding_kFaceWindow_CounterClockwise: ULFaceWinding = 1;
pub type ULFaceWinding = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Lighter hinting algorithm-- glyphs are slightly fuzzier but better"]
#[doc = " resemble their original shape. This is achieved by snapping glyphs to the"]
#[doc = " pixel grid only vertically which better preserves inter-glyph spacing."]
#[doc = ""]
pub const ULFontHinting_kFontHinting_Smooth: ULFontHinting = 0;
#[doc = ""]
#[doc = " Default hinting algorithm-- offers a good balance between sharpness and"]
#[doc = " shape at smaller font sizes."]
#[doc = ""]
pub const ULFontHinting_kFontHinting_Normal: ULFontHinting = 1;
#[doc = ""]
#[doc = " Strongest hinting algorithm-- outputs only black/white glyphs. The result"]
#[doc = " is usually unpleasant if the underlying TTF does not contain hints for"]
#[doc = " this type of rendering."]
#[doc = ""]
pub const ULFontHinting_kFontHinting_Monochrome: ULFontHinting = 2;
pub type ULFontHinting = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULRect {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}
#[test]
fn bindgen_test_layout_ULRect() {
assert_eq!(
::std::mem::size_of::<ULRect>(),
16usize,
concat!("Size of: ", stringify!(ULRect))
);
assert_eq!(
::std::mem::align_of::<ULRect>(),
4usize,
concat!("Alignment of ", stringify!(ULRect))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRect>())).left as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULRect),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRect>())).top as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULRect),
"::",
stringify!(top)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRect>())).right as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULRect),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRect>())).bottom as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ULRect),
"::",
stringify!(bottom)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULIntRect {
pub left: ::std::os::raw::c_int,
pub top: ::std::os::raw::c_int,
pub right: ::std::os::raw::c_int,
pub bottom: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_ULIntRect() {
assert_eq!(
::std::mem::size_of::<ULIntRect>(),
16usize,
concat!("Size of: ", stringify!(ULIntRect))
);
assert_eq!(
::std::mem::align_of::<ULIntRect>(),
4usize,
concat!("Alignment of ", stringify!(ULIntRect))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIntRect>())).left as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULIntRect),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIntRect>())).top as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULIntRect),
"::",
stringify!(top)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIntRect>())).right as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULIntRect),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIntRect>())).bottom as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ULIntRect),
"::",
stringify!(bottom)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULRenderTarget {
pub is_empty: bool,
pub width: ::std::os::raw::c_uint,
pub height: ::std::os::raw::c_uint,
pub texture_id: ::std::os::raw::c_uint,
pub texture_width: ::std::os::raw::c_uint,
pub texture_height: ::std::os::raw::c_uint,
pub texture_format: ULBitmapFormat,
pub uv_coords: ULRect,
pub render_buffer_id: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_ULRenderTarget() {
assert_eq!(
::std::mem::size_of::<ULRenderTarget>(),
48usize,
concat!("Size of: ", stringify!(ULRenderTarget))
);
assert_eq!(
::std::mem::align_of::<ULRenderTarget>(),
4usize,
concat!("Alignment of ", stringify!(ULRenderTarget))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).is_empty as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(is_empty)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).width as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(width)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).height as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(height)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).texture_id as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(texture_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).texture_width as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(texture_width)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).texture_height as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(texture_height)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).texture_format as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(texture_format)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).uv_coords as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(uv_coords)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderTarget>())).render_buffer_id as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(ULRenderTarget),
"::",
stringify!(render_buffer_id)
)
);
}
extern "C" {
#[doc = ""]
#[doc = " Get the version string of the library in MAJOR.MINOR.PATCH format."]
#[doc = ""]
pub fn ulVersionString() -> *const ::std::os::raw::c_char;
}
extern "C" {
#[doc = ""]
#[doc = " Get the numeric major version of the library."]
#[doc = ""]
pub fn ulVersionMajor() -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the numeric minor version of the library."]
#[doc = ""]
pub fn ulVersionMinor() -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the numeric patch version of the library."]
#[doc = ""]
pub fn ulVersionPatch() -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Create config with default values (see <Ultralight/platform/Config.h>)."]
#[doc = ""]
pub fn ulCreateConfig() -> ULConfig;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy config."]
#[doc = ""]
pub fn ulDestroyConfig(config: ULConfig);
}
extern "C" {
#[doc = ""]
#[doc = " Set the file path to the directory that contains Ultralight's bundled"]
#[doc = " resources (eg, cacert.pem and other localized resources)."]
#[doc = ""]
pub fn ulConfigSetResourcePath(config: ULConfig, resource_path: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set the file path to a writable directory that will be used to store"]
#[doc = " cookies, cached resources, and other persistent data."]
#[doc = ""]
pub fn ulConfigSetCachePath(config: ULConfig, cache_path: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " When enabled, each View will be rendered to an offscreen GPU texture"]
#[doc = " using the GPU driver set in ulPlatformSetGPUDriver. You can fetch"]
#[doc = " details for the texture via ulViewGetRenderTarget."]
#[doc = ""]
#[doc = " When disabled (the default), each View will be rendered to an offscreen"]
#[doc = " pixel buffer. This pixel buffer can optionally be provided by the user--"]
#[doc = " for more info see ulViewGetSurface."]
#[doc = ""]
pub fn ulConfigSetUseGPURenderer(config: ULConfig, use_gpu: bool);
}
extern "C" {
#[doc = ""]
#[doc = " Set the amount that the application DPI has been scaled, used for"]
#[doc = " scaling device coordinates to pixels and oversampling raster shapes"]
#[doc = " (Default = 1.0)."]
#[doc = ""]
pub fn ulConfigSetDeviceScale(config: ULConfig, value: f64);
}
extern "C" {
#[doc = ""]
#[doc = " The winding order for front-facing triangles. @see FaceWinding"]
#[doc = ""]
#[doc = " Note: This is only used with custom GPUDrivers"]
#[doc = ""]
pub fn ulConfigSetFaceWinding(config: ULConfig, winding: ULFaceWinding);
}
extern "C" {
#[doc = ""]
#[doc = " Set whether images should be enabled (Default = True)."]
#[doc = ""]
pub fn ulConfigSetEnableImages(config: ULConfig, enabled: bool);
}
extern "C" {
#[doc = ""]
#[doc = " Set whether JavaScript should be eanbled (Default = True)."]
#[doc = ""]
pub fn ulConfigSetEnableJavaScript(config: ULConfig, enabled: bool);
}
extern "C" {
#[doc = ""]
#[doc = " The hinting algorithm to use when rendering fonts. (Default = kFontHinting_Normal)"]
#[doc = " @see ULFontHinting"]
#[doc = ""]
pub fn ulConfigSetFontHinting(config: ULConfig, font_hinting: ULFontHinting);
}
extern "C" {
#[doc = ""]
#[doc = " The gamma to use when compositing font glyphs, change this value to"]
#[doc = " adjust contrast (Adobe and Apple prefer 1.8, others may prefer 2.2)."]
#[doc = " (Default = 1.8)"]
#[doc = ""]
pub fn ulConfigSetFontGamma(config: ULConfig, font_gamma: f64);
}
extern "C" {
#[doc = ""]
#[doc = " Set default font-family to use (Default = Times New Roman)."]
#[doc = ""]
pub fn ulConfigSetFontFamilyStandard(config: ULConfig, font_name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set default font-family to use for fixed fonts, eg <pre> and <code>"]
#[doc = " (Default = Courier New)."]
#[doc = ""]
pub fn ulConfigSetFontFamilyFixed(config: ULConfig, font_name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set default font-family to use for serif fonts (Default = Times New Roman)."]
#[doc = ""]
pub fn ulConfigSetFontFamilySerif(config: ULConfig, font_name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set default font-family to use for sans-serif fonts (Default = Arial)."]
#[doc = ""]
pub fn ulConfigSetFontFamilySansSerif(config: ULConfig, font_name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set user agent string (See <Ultralight/platform/Config.h> for the default)."]
#[doc = ""]
pub fn ulConfigSetUserAgent(config: ULConfig, agent_string: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set user stylesheet (CSS) (Default = Empty)."]
#[doc = ""]
pub fn ulConfigSetUserStylesheet(config: ULConfig, css_string: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set whether or not we should continuously repaint any Views or compositor"]
#[doc = " layers, regardless if they are dirty or not. This is mainly used to"]
#[doc = " diagnose painting/shader issues. (Default = False)"]
#[doc = ""]
pub fn ulConfigSetForceRepaint(config: ULConfig, enabled: bool);
}
extern "C" {
#[doc = ""]
#[doc = " Set the amount of time to wait before triggering another repaint when a"]
#[doc = " CSS animation is active. (Default = 1.0 / 60.0)"]
#[doc = ""]
pub fn ulConfigSetAnimationTimerDelay(config: ULConfig, delay: f64);
}
extern "C" {
#[doc = ""]
#[doc = " When a smooth scroll animation is active, the amount of time (in seconds)"]
#[doc = " to wait before triggering another repaint. Default is 60 Hz."]
#[doc = ""]
pub fn ulConfigSetScrollTimerDelay(config: ULConfig, delay: f64);
}
extern "C" {
#[doc = ""]
#[doc = " The amount of time (in seconds) to wait before running the recycler (will"]
#[doc = " attempt to return excess memory back to the system). (Default = 4.0)"]
#[doc = ""]
pub fn ulConfigSetRecycleDelay(config: ULConfig, delay: f64);
}
extern "C" {
#[doc = ""]
#[doc = " Set the size of WebCore's memory cache for decoded images, scripts, and"]
#[doc = " other assets in bytes. (Default = 64 * 1024 * 1024)"]
#[doc = ""]
pub fn ulConfigSetMemoryCacheSize(config: ULConfig, size: ::std::os::raw::c_uint);
}
extern "C" {
#[doc = ""]
#[doc = " Set the number of pages to keep in the cache. (Default = 0)"]
#[doc = ""]
pub fn ulConfigSetPageCacheSize(config: ULConfig, size: ::std::os::raw::c_uint);
}
extern "C" {
#[doc = ""]
#[doc = " JavaScriptCore tries to detect the system's physical RAM size to set"]
#[doc = " reasonable allocation limits. Set this to anything other than 0 to"]
#[doc = " override the detected value. Size is in bytes."]
#[doc = ""]
#[doc = " This can be used to force JavaScriptCore to be more conservative with"]
#[doc = " its allocation strategy (at the cost of some performance)."]
#[doc = ""]
pub fn ulConfigSetOverrideRAMSize(config: ULConfig, size: ::std::os::raw::c_uint);
}
extern "C" {
#[doc = ""]
#[doc = " The minimum size of large VM heaps in JavaScriptCore. Set this to a"]
#[doc = " lower value to make these heaps start with a smaller initial value."]
#[doc = ""]
pub fn ulConfigSetMinLargeHeapSize(config: ULConfig, size: ::std::os::raw::c_uint);
}
extern "C" {
#[doc = ""]
#[doc = " The minimum size of small VM heaps in JavaScriptCore. Set this to a"]
#[doc = " lower value to make these heaps start with a smaller initial value."]
#[doc = ""]
pub fn ulConfigSetMinSmallHeapSize(config: ULConfig, size: ::std::os::raw::c_uint);
}
extern "C" {
#[doc = ""]
#[doc = " Create the Ultralight Renderer directly."]
#[doc = ""]
#[doc = " Unlike ulCreateApp(), this does not use any native windows for drawing"]
#[doc = " and allows you to manage your own runloop and painting. This method is"]
#[doc = " recommended for those wishing to integrate the library into a game."]
#[doc = ""]
#[doc = " This singleton manages the lifetime of all Views and coordinates all"]
#[doc = " painting, rendering, network requests, and event dispatch."]
#[doc = ""]
#[doc = " You should only call this once per process lifetime."]
#[doc = ""]
#[doc = " You shoud set up your platform handlers (eg, ulPlatformSetLogger,"]
#[doc = " ulPlatformSetFileSystem, etc.) before calling this."]
#[doc = ""]
#[doc = " You will also need to define a font loader before calling this--"]
#[doc = " as of this writing (v1.2) the only way to do this in C API is by calling"]
#[doc = " ulEnablePlatformFontLoader() (available in <AppCore/CAPI.h>)."]
#[doc = ""]
#[doc = " @NOTE: You should not call this if you are using ulCreateApp(), it"]
#[doc = " creates its own renderer and provides default implementations for"]
#[doc = " various platform handlers automatically."]
#[doc = ""]
pub fn ulCreateRenderer(config: ULConfig) -> ULRenderer;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy the renderer."]
#[doc = ""]
pub fn ulDestroyRenderer(renderer: ULRenderer);
}
extern "C" {
#[doc = ""]
#[doc = " Update timers and dispatch internal callbacks (JavaScript and network)."]
#[doc = ""]
pub fn ulUpdate(renderer: ULRenderer);
}
extern "C" {
#[doc = ""]
#[doc = " Render all active Views."]
#[doc = ""]
pub fn ulRender(renderer: ULRenderer);
}
extern "C" {
#[doc = ""]
#[doc = " Attempt to release as much memory as possible. Don't call this from any"]
#[doc = " callbacks or driver code."]
#[doc = ""]
pub fn ulPurgeMemory(renderer: ULRenderer);
}
extern "C" {
#[doc = ""]
#[doc = " Print detailed memory usage statistics to the log."]
#[doc = " (@see ulPlatformSetLogger)"]
#[doc = ""]
pub fn ulLogMemoryUsage(renderer: ULRenderer);
}
extern "C" {
#[doc = ""]
#[doc = " Create a Session to store local data in (such as cookies, local storage,"]
#[doc = " application cache, indexed db, etc)."]
#[doc = ""]
pub fn ulCreateSession(renderer: ULRenderer, is_persistent: bool, name: ULString) -> ULSession;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a Session."]
#[doc = ""]
pub fn ulDestroySession(session: ULSession);
}
extern "C" {
#[doc = ""]
#[doc = " Get the default session (persistent session named \"default\")."]
#[doc = ""]
#[doc = " @note This session is owned by the Renderer, you shouldn't destroy it."]
#[doc = ""]
pub fn ulDefaultSession(renderer: ULRenderer) -> ULSession;
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not is persistent (backed to disk)."]
#[doc = ""]
pub fn ulSessionIsPersistent(session: ULSession) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Unique name identifying the session (used for unique disk path)."]
#[doc = ""]
pub fn ulSessionGetName(session: ULSession) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Unique numeric Id for the session."]
#[doc = ""]
pub fn ulSessionGetId(session: ULSession) -> ::std::os::raw::c_ulonglong;
}
extern "C" {
#[doc = ""]
#[doc = " The disk path to write to (used by persistent sessions only)."]
#[doc = ""]
pub fn ulSessionGetDiskPath(session: ULSession) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Create a View with certain size (in pixels)."]
#[doc = ""]
#[doc = " @note You can pass null to 'session' to use the default session."]
#[doc = ""]
pub fn ulCreateView(
renderer: ULRenderer,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
transparent: bool,
session: ULSession,
force_cpu_renderer: bool,
) -> ULView;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a View."]
#[doc = ""]
pub fn ulDestroyView(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Get current URL."]
#[doc = ""]
#[doc = " @note Don't destroy the returned string, it is owned by the View."]
#[doc = ""]
pub fn ulViewGetURL(view: ULView) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Get current title."]
#[doc = ""]
#[doc = " @note Don't destroy the returned string, it is owned by the View."]
#[doc = ""]
pub fn ulViewGetTitle(view: ULView) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Get the width, in pixels."]
#[doc = ""]
pub fn ulViewGetWidth(view: ULView) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the height, in pixels."]
#[doc = ""]
pub fn ulViewGetHeight(view: ULView) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Check if main frame is loading."]
#[doc = ""]
pub fn ulViewIsLoading(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Get the RenderTarget for the View."]
#[doc = ""]
#[doc = " @note Only valid when the GPU renderer is enabled in Config."]
#[doc = ""]
pub fn ulViewGetRenderTarget(view: ULView) -> ULRenderTarget;
}
extern "C" {
#[doc = ""]
#[doc = " Get the Surface for the View (native pixel buffer container)."]
#[doc = ""]
#[doc = " @note Only valid when the GPU renderer is disabled in Config."]
#[doc = ""]
#[doc = " (Will return a nullptr when the GPU renderer is enabled.)"]
#[doc = ""]
#[doc = " The default Surface is BitmapSurface but you can provide your"]
#[doc = " own Surface implementation via ulPlatformSetSurfaceDefinition."]
#[doc = ""]
#[doc = " When using the default Surface, you can retrieve the underlying"]
#[doc = " bitmap by casting ULSurface to ULBitmapSurface and calling"]
#[doc = " ulBitmapSurfaceGetBitmap()."]
#[doc = ""]
pub fn ulViewGetSurface(view: ULView) -> ULSurface;
}
extern "C" {
#[doc = ""]
#[doc = " Load a raw string of HTML."]
#[doc = ""]
pub fn ulViewLoadHTML(view: ULView, html_string: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Load a URL into main frame."]
#[doc = ""]
pub fn ulViewLoadURL(view: ULView, url_string: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Resize view to a certain width and height (in pixels)."]
#[doc = ""]
pub fn ulViewResize(
view: ULView,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
);
}
extern "C" {
#[doc = ""]
#[doc = " Acquire the page's JSContext for use with JavaScriptCore API."]
#[doc = ""]
#[doc = " @note This call locks the context for the current thread. You should"]
#[doc = " call ulViewUnlockJSContext() after using the context so other"]
#[doc = " worker threads can modify JavaScript state."]
#[doc = ""]
#[doc = " @note The lock is recusive, it's okay to call this multiple times as long"]
#[doc = " as you call ulViewUnlockJSContext() the same number of times."]
#[doc = ""]
pub fn ulViewLockJSContext(view: ULView) -> JSContextRef;
}
extern "C" {
#[doc = ""]
#[doc = " Unlock the page's JSContext after a previous call to ulViewLockJSContext()."]
#[doc = ""]
pub fn ulViewUnlockJSContext(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Evaluate a string of JavaScript and return result."]
#[doc = ""]
#[doc = " @param js_string The string of JavaScript to evaluate."]
#[doc = ""]
#[doc = " @param exception The address of a ULString to store a description of the"]
#[doc = " last exception. Pass NULL to ignore this. Don't destroy"]
#[doc = " the exception string returned, it's owned by the View."]
#[doc = ""]
#[doc = " @note Don't destroy the returned string, it's owned by the View. This value"]
#[doc = " is reset with every call-- if you want to retain it you should copy"]
#[doc = " the result to a new string via ulCreateStringFromCopy()."]
#[doc = ""]
#[doc = " @note An example of using this API:"]
#[doc = " <pre>"]
#[doc = " ULString script = ulCreateString(\"1 + 1\");"]
#[doc = " ULString exception;"]
#[doc = " ULString result = ulViewEvaluateScript(view, script, &exception);"]
#[doc = " /* Use the result (\"2\") and exception description (if any) here. */"]
#[doc = " ulDestroyString(script);"]
#[doc = " </pre>"]
#[doc = ""]
pub fn ulViewEvaluateScript(
view: ULView,
js_string: ULString,
exception: *mut ULString,
) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Check if can navigate backwards in history."]
#[doc = ""]
pub fn ulViewCanGoBack(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Check if can navigate forwards in history."]
#[doc = ""]
pub fn ulViewCanGoForward(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Navigate backwards in history."]
#[doc = ""]
pub fn ulViewGoBack(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Navigate forwards in history."]
#[doc = ""]
pub fn ulViewGoForward(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Navigate to arbitrary offset in history."]
#[doc = ""]
pub fn ulViewGoToHistoryOffset(view: ULView, offset: ::std::os::raw::c_int);
}
extern "C" {
#[doc = ""]
#[doc = " Reload current page."]
#[doc = ""]
pub fn ulViewReload(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Stop all page loads."]
#[doc = ""]
pub fn ulViewStop(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Give focus to the View."]
#[doc = ""]
#[doc = " You should call this to give visual indication that the View has input"]
#[doc = " focus (changes active text selection colors, for example)."]
#[doc = ""]
pub fn ulViewFocus(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Remove focus from the View and unfocus any focused input elements."]
#[doc = ""]
#[doc = " You should call this to give visual indication that the View has lost"]
#[doc = " input focus."]
#[doc = ""]
pub fn ulViewUnfocus(view: ULView);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not the View has focus."]
#[doc = ""]
pub fn ulViewHasFocus(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not the View has an input element with visible keyboard focus"]
#[doc = " (indicated by a blinking caret)."]
#[doc = ""]
#[doc = " You can use this to decide whether or not the View should consume"]
#[doc = " keyboard input events (useful in games with mixed UI and key handling)."]
#[doc = ""]
pub fn ulViewHasInputFocus(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Fire a keyboard event."]
#[doc = ""]
pub fn ulViewFireKeyEvent(view: ULView, key_event: ULKeyEvent);
}
extern "C" {
#[doc = ""]
#[doc = " Fire a mouse event."]
#[doc = ""]
pub fn ulViewFireMouseEvent(view: ULView, mouse_event: ULMouseEvent);
}
extern "C" {
#[doc = ""]
#[doc = " Fire a scroll event."]
#[doc = ""]
pub fn ulViewFireScrollEvent(view: ULView, scroll_event: ULScrollEvent);
}
pub type ULChangeTitleCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, caller: ULView, title: ULString),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the page title changes."]
#[doc = ""]
pub fn ulViewSetChangeTitleCallback(
view: ULView,
callback: ULChangeTitleCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULChangeURLCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, caller: ULView, url: ULString),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the page URL changes."]
#[doc = ""]
pub fn ulViewSetChangeURLCallback(
view: ULView,
callback: ULChangeURLCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULChangeTooltipCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, caller: ULView, tooltip: ULString),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the tooltip changes (usually result of a mouse hover)."]
#[doc = ""]
pub fn ulViewSetChangeTooltipCallback(
view: ULView,
callback: ULChangeTooltipCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULChangeCursorCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, caller: ULView, cursor: ULCursor),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the mouse cursor changes."]
#[doc = ""]
pub fn ulViewSetChangeCursorCallback(
view: ULView,
callback: ULChangeCursorCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULAddConsoleMessageCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
source: ULMessageSource,
level: ULMessageLevel,
message: ULString,
line_number: ::std::os::raw::c_uint,
column_number: ::std::os::raw::c_uint,
source_id: ULString,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when a message is added to the console (useful for"]
#[doc = " JavaScript / network errors and debugging)."]
#[doc = ""]
pub fn ulViewSetAddConsoleMessageCallback(
view: ULView,
callback: ULAddConsoleMessageCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULCreateChildViewCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
opener_url: ULString,
target_url: ULString,
is_popup: bool,
popup_rect: ULIntRect,
) -> ULView,
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the page wants to create a new View."]
#[doc = ""]
#[doc = " This is usually the result of a user clicking a link with target=\"_blank\""]
#[doc = " or by JavaScript calling window.open(url)."]
#[doc = ""]
#[doc = " To allow creation of these new Views, you should create a new View in"]
#[doc = " this callback, resize it to your container,"]
#[doc = " and return it. You are responsible for displaying the returned View."]
#[doc = ""]
#[doc = " You should return NULL if you want to block the action."]
#[doc = ""]
pub fn ulViewSetCreateChildViewCallback(
view: ULView,
callback: ULCreateChildViewCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULBeginLoadingCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
frame_id: ::std::os::raw::c_ulonglong,
is_main_frame: bool,
url: ULString,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the page begins loading a new URL into a frame."]
#[doc = ""]
pub fn ulViewSetBeginLoadingCallback(
view: ULView,
callback: ULBeginLoadingCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULFinishLoadingCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
frame_id: ::std::os::raw::c_ulonglong,
is_main_frame: bool,
url: ULString,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the page finishes loading a URL into a frame."]
#[doc = ""]
pub fn ulViewSetFinishLoadingCallback(
view: ULView,
callback: ULFinishLoadingCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULFailLoadingCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
frame_id: ::std::os::raw::c_ulonglong,
is_main_frame: bool,
url: ULString,
description: ULString,
error_domain: ULString,
error_code: ::std::os::raw::c_int,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when an error occurs while loading a URL into a frame."]
#[doc = ""]
pub fn ulViewSetFailLoadingCallback(
view: ULView,
callback: ULFailLoadingCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULWindowObjectReadyCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
frame_id: ::std::os::raw::c_ulonglong,
is_main_frame: bool,
url: ULString,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the JavaScript window object is reset for a new"]
#[doc = " page load."]
#[doc = ""]
#[doc = " This is called before any scripts are executed on the page and is the"]
#[doc = " earliest time to setup any initial JavaScript state or bindings."]
#[doc = ""]
#[doc = " The document is not guaranteed to be loaded/parsed at this point. If"]
#[doc = " you need to make any JavaScript calls that are dependent on DOM elements"]
#[doc = " or scripts on the page, use DOMReady instead."]
#[doc = ""]
#[doc = " The window object is lazily initialized (this will not be called on pages"]
#[doc = " with no scripts)."]
#[doc = ""]
pub fn ulViewSetWindowObjectReadyCallback(
view: ULView,
callback: ULWindowObjectReadyCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULDOMReadyCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
caller: ULView,
frame_id: ::std::os::raw::c_ulonglong,
is_main_frame: bool,
url: ULString,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when all JavaScript has been parsed and the document is"]
#[doc = " ready."]
#[doc = ""]
#[doc = " This is the best time to make any JavaScript calls that are dependent on"]
#[doc = " DOM elements or scripts on the page."]
#[doc = ""]
pub fn ulViewSetDOMReadyCallback(
view: ULView,
callback: ULDOMReadyCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULUpdateHistoryCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, caller: ULView),
>;
extern "C" {
#[doc = ""]
#[doc = " Set callback for when the history (back/forward state) is modified."]
#[doc = ""]
pub fn ulViewSetUpdateHistoryCallback(
view: ULView,
callback: ULUpdateHistoryCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
extern "C" {
#[doc = ""]
#[doc = " Set whether or not a view should be repainted during the next call to"]
#[doc = " ulRender."]
#[doc = ""]
#[doc = " @note This flag is automatically set whenever the page content changes"]
#[doc = " but you can set it directly in case you need to force a repaint."]
#[doc = ""]
pub fn ulViewSetNeedsPaint(view: ULView, needs_paint: bool);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not a view should be painted during the next call to ulRender."]
#[doc = ""]
pub fn ulViewGetNeedsPaint(view: ULView) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Create an inspector for this View, this is useful for debugging and"]
#[doc = " inspecting pages locally. This will only succeed if you have the"]
#[doc = " inspector assets in your filesystem-- the inspector will look for"]
#[doc = " file:///inspector/Main.html when it loads."]
#[doc = ""]
#[doc = " @note The initial dimensions of the returned View are 10x10, you should"]
#[doc = " call ulViewResize on the returned View to resize it to your desired"]
#[doc = " dimensions."]
#[doc = ""]
#[doc = " @note You will need to call ulDestroyView on the returned instance"]
#[doc = " when you're done using it."]
#[doc = ""]
pub fn ulViewCreateInspectorView(view: ULView) -> ULView;
}
extern "C" {
#[doc = ""]
#[doc = " Create string from null-terminated ASCII C-string."]
#[doc = ""]
pub fn ulCreateString(str_: *const ::std::os::raw::c_char) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Create string from UTF-8 buffer."]
#[doc = ""]
pub fn ulCreateStringUTF8(str_: *const ::std::os::raw::c_char, len: size_t) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Create string from UTF-16 buffer."]
#[doc = ""]
pub fn ulCreateStringUTF16(str_: *mut ULChar16, len: size_t) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Create string from copy of existing string."]
#[doc = ""]
pub fn ulCreateStringFromCopy(str_: ULString) -> ULString;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy string (you should destroy any strings you explicitly Create)."]
#[doc = ""]
pub fn ulDestroyString(str_: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Get internal UTF-16 buffer data."]
#[doc = ""]
pub fn ulStringGetData(str_: ULString) -> *mut ULChar16;
}
extern "C" {
#[doc = ""]
#[doc = " Get length in UTF-16 characters."]
#[doc = ""]
pub fn ulStringGetLength(str_: ULString) -> size_t;
}
extern "C" {
#[doc = ""]
#[doc = " Whether this string is empty or not."]
#[doc = ""]
pub fn ulStringIsEmpty(str_: ULString) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Replaces the contents of 'str' with the contents of 'new_str'"]
#[doc = ""]
pub fn ulStringAssignString(str_: ULString, new_str: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Replaces the contents of 'str' with the contents of a C-string."]
#[doc = ""]
pub fn ulStringAssignCString(str_: ULString, c_str: *const ::std::os::raw::c_char);
}
extern "C" {
#[doc = ""]
#[doc = " Create empty bitmap."]
#[doc = ""]
pub fn ulCreateEmptyBitmap() -> ULBitmap;
}
extern "C" {
#[doc = ""]
#[doc = " Create bitmap with certain dimensions and pixel format."]
#[doc = ""]
pub fn ulCreateBitmap(
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
format: ULBitmapFormat,
) -> ULBitmap;
}
extern "C" {
#[doc = ""]
#[doc = " Create bitmap from existing pixel buffer. @see Bitmap for help using"]
#[doc = " this function."]
#[doc = ""]
pub fn ulCreateBitmapFromPixels(
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
format: ULBitmapFormat,
row_bytes: ::std::os::raw::c_uint,
pixels: *const ::std::os::raw::c_void,
size: size_t,
should_copy: bool,
) -> ULBitmap;
}
extern "C" {
#[doc = ""]
#[doc = " Create bitmap from copy."]
#[doc = ""]
pub fn ulCreateBitmapFromCopy(existing_bitmap: ULBitmap) -> ULBitmap;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a bitmap (you should only destroy Bitmaps you have explicitly"]
#[doc = " created via one of the creation functions above."]
#[doc = ""]
pub fn ulDestroyBitmap(bitmap: ULBitmap);
}
extern "C" {
#[doc = ""]
#[doc = " Get the width in pixels."]
#[doc = ""]
pub fn ulBitmapGetWidth(bitmap: ULBitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the height in pixels."]
#[doc = ""]
pub fn ulBitmapGetHeight(bitmap: ULBitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the pixel format."]
#[doc = ""]
pub fn ulBitmapGetFormat(bitmap: ULBitmap) -> ULBitmapFormat;
}
extern "C" {
#[doc = ""]
#[doc = " Get the bytes per pixel."]
#[doc = ""]
pub fn ulBitmapGetBpp(bitmap: ULBitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the number of bytes per row."]
#[doc = ""]
pub fn ulBitmapGetRowBytes(bitmap: ULBitmap) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the size in bytes of the underlying pixel buffer."]
#[doc = ""]
pub fn ulBitmapGetSize(bitmap: ULBitmap) -> size_t;
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not this bitmap owns its own pixel buffer."]
#[doc = ""]
pub fn ulBitmapOwnsPixels(bitmap: ULBitmap) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Lock pixels for reading/writing, returns pointer to pixel buffer."]
#[doc = ""]
pub fn ulBitmapLockPixels(bitmap: ULBitmap) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = ""]
#[doc = " Unlock pixels after locking."]
#[doc = ""]
pub fn ulBitmapUnlockPixels(bitmap: ULBitmap);
}
extern "C" {
#[doc = ""]
#[doc = " Get raw pixel buffer-- you should only call this if Bitmap is already"]
#[doc = " locked."]
#[doc = ""]
pub fn ulBitmapRawPixels(bitmap: ULBitmap) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not this bitmap is empty."]
#[doc = ""]
pub fn ulBitmapIsEmpty(bitmap: ULBitmap) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Reset bitmap pixels to 0."]
#[doc = ""]
pub fn ulBitmapErase(bitmap: ULBitmap);
}
extern "C" {
#[doc = ""]
#[doc = " Write bitmap to a PNG on disk."]
#[doc = ""]
pub fn ulBitmapWritePNG(bitmap: ULBitmap, path: *const ::std::os::raw::c_char) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " This converts a BGRA bitmap to RGBA bitmap and vice-versa by swapping"]
#[doc = " the red and blue channels."]
#[doc = ""]
pub fn ulBitmapSwapRedBlueChannels(bitmap: ULBitmap);
}
extern "C" {
#[doc = ""]
#[doc = " Create a key event, @see KeyEvent for help with the following parameters."]
#[doc = ""]
pub fn ulCreateKeyEvent(
type_: ULKeyEventType,
modifiers: ::std::os::raw::c_uint,
virtual_key_code: ::std::os::raw::c_int,
native_key_code: ::std::os::raw::c_int,
text: ULString,
unmodified_text: ULString,
is_keypad: bool,
is_auto_repeat: bool,
is_system_key: bool,
) -> ULKeyEvent;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a key event."]
#[doc = ""]
pub fn ulDestroyKeyEvent(evt: ULKeyEvent);
}
extern "C" {
#[doc = ""]
#[doc = " Create a mouse event, @see MouseEvent for help using this function."]
#[doc = ""]
pub fn ulCreateMouseEvent(
type_: ULMouseEventType,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
button: ULMouseButton,
) -> ULMouseEvent;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a mouse event."]
#[doc = ""]
pub fn ulDestroyMouseEvent(evt: ULMouseEvent);
}
extern "C" {
#[doc = ""]
#[doc = " Create a scroll event, @see ScrollEvent for help using this function."]
#[doc = ""]
pub fn ulCreateScrollEvent(
type_: ULScrollEventType,
delta_x: ::std::os::raw::c_int,
delta_y: ::std::os::raw::c_int,
) -> ULScrollEvent;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a scroll event."]
#[doc = ""]
pub fn ulDestroyScrollEvent(evt: ULScrollEvent);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not a ULRect is empty (all members equal to 0)"]
#[doc = ""]
pub fn ulRectIsEmpty(rect: ULRect) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Create an empty ULRect (all members equal to 0)"]
#[doc = ""]
pub fn ulRectMakeEmpty() -> ULRect;
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not a ULIntRect is empty (all members equal to 0)"]
#[doc = ""]
pub fn ulIntRectIsEmpty(rect: ULIntRect) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Create an empty ULIntRect (all members equal to 0)"]
#[doc = ""]
pub fn ulIntRectMakeEmpty() -> ULIntRect;
}
extern "C" {
#[doc = ""]
#[doc = " Width (in pixels)."]
#[doc = ""]
pub fn ulSurfaceGetWidth(surface: ULSurface) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Height (in pixels)."]
#[doc = ""]
pub fn ulSurfaceGetHeight(surface: ULSurface) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Number of bytes between rows (usually width * 4)"]
#[doc = ""]
pub fn ulSurfaceGetRowBytes(surface: ULSurface) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Size in bytes."]
#[doc = ""]
pub fn ulSurfaceGetSize(surface: ULSurface) -> size_t;
}
extern "C" {
#[doc = ""]
#[doc = " Lock the pixel buffer and get a pointer to the beginning of the data"]
#[doc = " for reading/writing."]
#[doc = ""]
#[doc = " Native pixel format is premultiplied BGRA 32-bit (8 bits per channel)."]
#[doc = ""]
pub fn ulSurfaceLockPixels(surface: ULSurface) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = ""]
#[doc = " Unlock the pixel buffer."]
#[doc = ""]
pub fn ulSurfaceUnlockPixels(surface: ULSurface);
}
extern "C" {
#[doc = ""]
#[doc = " Resize the pixel buffer to a certain width and height (both in pixels)."]
#[doc = ""]
#[doc = " This should never be called while pixels are locked."]
#[doc = ""]
pub fn ulSurfaceResize(
surface: ULSurface,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
);
}
extern "C" {
#[doc = ""]
#[doc = " Set the dirty bounds to a certain value."]
#[doc = ""]
#[doc = " This is called after the Renderer paints to an area of the pixel buffer."]
#[doc = " (The new value will be joined with the existing dirty_bounds())"]
#[doc = ""]
pub fn ulSurfaceSetDirtyBounds(surface: ULSurface, bounds: ULIntRect);
}
extern "C" {
#[doc = ""]
#[doc = " Get the dirty bounds."]
#[doc = ""]
#[doc = " This value can be used to determine which portion of the pixel buffer has"]
#[doc = " been updated since the last call to ulSurfaceClearDirtyBounds()."]
#[doc = ""]
#[doc = " The general algorithm to determine if a Surface needs display is:"]
#[doc = " <pre>"]
#[doc = " if (!ulIntRectIsEmpty(ulSurfaceGetDirtyBounds(surface))) {"]
#[doc = " // Surface pixels are dirty and needs display."]
#[doc = " // Cast Surface to native Surface and use it here (pseudo code)"]
#[doc = " DisplaySurface(surface);"]
#[doc = ""]
#[doc = " // Once you're done, clear the dirty bounds:"]
#[doc = " ulSurfaceClearDirtyBounds(surface);"]
#[doc = " }"]
#[doc = " </pre>"]
#[doc = ""]
pub fn ulSurfaceGetDirtyBounds(surface: ULSurface) -> ULIntRect;
}
extern "C" {
#[doc = ""]
#[doc = " Clear the dirty bounds."]
#[doc = ""]
#[doc = " You should call this after you're done displaying the Surface."]
#[doc = ""]
pub fn ulSurfaceClearDirtyBounds(surface: ULSurface);
}
extern "C" {
#[doc = ""]
#[doc = " Get the underlying user data pointer (this is only valid if you have"]
#[doc = " set a custom surface implementation via ulPlatformSetSurfaceDefinition)."]
#[doc = ""]
#[doc = " This will return nullptr if this surface is the default ULBitmapSurface."]
#[doc = ""]
pub fn ulSurfaceGetUserData(surface: ULSurface) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = ""]
#[doc = " Get the underlying Bitmap from the default Surface."]
#[doc = ""]
#[doc = " @note Do not call ulDestroyBitmap() on the returned value, it is owned"]
#[doc = " by the surface."]
#[doc = ""]
pub fn ulBitmapSurfaceGetBitmap(surface: ULBitmapSurface) -> ULBitmap;
}
#[doc = ""]
#[doc = " The callback invoked when a Surface is created."]
#[doc = ""]
#[doc = " @param width The width in pixels."]
#[doc = " @param height The height in pixels."]
#[doc = ""]
#[doc = " @return This callback should return a pointer to user-defined data for the"]
#[doc = " instance. This user data pointer will be passed to all other"]
#[doc = " callbacks when operating on the instance."]
#[doc = ""]
pub type ULSurfaceDefinitionCreateCallback = ::std::option::Option<
unsafe extern "C" fn(
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
) -> *mut ::std::os::raw::c_void,
>;
#[doc = ""]
#[doc = " The callback invoked when a Surface is destroyed."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionDestroyCallback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's width (in pixels) is requested."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionGetWidthCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uint,
>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's height (in pixels) is requested."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionGetHeightCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uint,
>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's row bytes is requested."]
#[doc = ""]
#[doc = " @note This value is also known as \"stride\". Usually width * 4."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionGetRowBytesCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_uint,
>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's size (in bytes) is requested."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionGetSizeCallback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> size_t>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's pixel buffer is requested to be"]
#[doc = " locked for reading/writing (should return a pointer to locked bytes)."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionLockPixelsCallback = ::std::option::Option<
unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
>;
#[doc = ""]
#[doc = " The callback invoked when a Surface's pixel buffer is requested to be"]
#[doc = " unlocked after previously being locked."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = ""]
pub type ULSurfaceDefinitionUnlockPixelsCallback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>;
#[doc = ""]
#[doc = " The callback invoked when a Surface is requested to be resized to a"]
#[doc = " certain width/height."]
#[doc = ""]
#[doc = " @param user_data User data pointer uniquely identifying the surface."]
#[doc = " @param width Width in pixels."]
#[doc = " @param height Height in pixels."]
#[doc = ""]
pub type ULSurfaceDefinitionResizeCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULSurfaceDefinition {
pub create: ULSurfaceDefinitionCreateCallback,
pub destroy: ULSurfaceDefinitionDestroyCallback,
pub get_width: ULSurfaceDefinitionGetWidthCallback,
pub get_height: ULSurfaceDefinitionGetHeightCallback,
pub get_row_bytes: ULSurfaceDefinitionGetRowBytesCallback,
pub get_size: ULSurfaceDefinitionGetSizeCallback,
pub lock_pixels: ULSurfaceDefinitionLockPixelsCallback,
pub unlock_pixels: ULSurfaceDefinitionUnlockPixelsCallback,
pub resize: ULSurfaceDefinitionResizeCallback,
}
#[test]
fn bindgen_test_layout_ULSurfaceDefinition() {
assert_eq!(
::std::mem::size_of::<ULSurfaceDefinition>(),
72usize,
concat!("Size of: ", stringify!(ULSurfaceDefinition))
);
assert_eq!(
::std::mem::align_of::<ULSurfaceDefinition>(),
8usize,
concat!("Alignment of ", stringify!(ULSurfaceDefinition))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).create as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(create)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).destroy as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(destroy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).get_width as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(get_width)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).get_height as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(get_height)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULSurfaceDefinition>())).get_row_bytes as *const _ as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(get_row_bytes)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).get_size as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(get_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).lock_pixels as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(lock_pixels)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULSurfaceDefinition>())).unlock_pixels as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(unlock_pixels)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULSurfaceDefinition>())).resize as *const _ as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(ULSurfaceDefinition),
"::",
stringify!(resize)
)
);
}
pub type ULFileHandle = ::std::os::raw::c_int;
pub const ULInvalidFileHandle: ULFileHandle = -1;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to check if a file path"]
#[doc = " exists, return true if it exists."]
#[doc = ""]
pub type ULFileSystemFileExistsCallback =
::std::option::Option<unsafe extern "C" fn(path: ULString) -> bool>;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to get the file size of a"]
#[doc = " previously opened file, store result in 'result'. Return true on success."]
#[doc = ""]
pub type ULFileSystemGetFileSizeCallback = ::std::option::Option<
unsafe extern "C" fn(handle: ULFileHandle, result: *mut ::std::os::raw::c_longlong) -> bool,
>;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to get the mime type of a"]
#[doc = " file (eg \"text/html\"), store result in 'result'. Return true on success."]
#[doc = ""]
pub type ULFileSystemGetFileMimeTypeCallback =
::std::option::Option<unsafe extern "C" fn(path: ULString, result: ULString) -> bool>;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to open a file path for"]
#[doc = " reading or writing. Return file handle on success, or ULInvalidFileHandle"]
#[doc = " on failure."]
#[doc = ""]
#[doc = " @NOTE: As of this writing (v1.2), this function is only used for reading."]
#[doc = ""]
pub type ULFileSystemOpenFileCallback = ::std::option::Option<
unsafe extern "C" fn(path: ULString, open_for_writing: bool) -> ULFileHandle,
>;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to close a previously-opened"]
#[doc = " file."]
#[doc = ""]
pub type ULFileSystemCloseFileCallback =
::std::option::Option<unsafe extern "C" fn(handle: ULFileHandle)>;
#[doc = ""]
#[doc = " The callback invoked when the FileSystem wants to read from a"]
#[doc = " currently-opened file, return number of bytes read or -1 on failure."]
#[doc = ""]
pub type ULFileSystemReadFromFileCallback = ::std::option::Option<
unsafe extern "C" fn(
handle: ULFileHandle,
data: *mut ::std::os::raw::c_char,
length: ::std::os::raw::c_longlong,
) -> ::std::os::raw::c_longlong,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULFileSystem {
pub file_exists: ULFileSystemFileExistsCallback,
pub get_file_size: ULFileSystemGetFileSizeCallback,
pub get_file_mime_type: ULFileSystemGetFileMimeTypeCallback,
pub open_file: ULFileSystemOpenFileCallback,
pub close_file: ULFileSystemCloseFileCallback,
pub read_from_file: ULFileSystemReadFromFileCallback,
}
#[test]
fn bindgen_test_layout_ULFileSystem() {
assert_eq!(
::std::mem::size_of::<ULFileSystem>(),
48usize,
concat!("Size of: ", stringify!(ULFileSystem))
);
assert_eq!(
::std::mem::align_of::<ULFileSystem>(),
8usize,
concat!("Alignment of ", stringify!(ULFileSystem))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).file_exists as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(file_exists)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).get_file_size as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(get_file_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).get_file_mime_type as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(get_file_mime_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).open_file as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(open_file)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).close_file as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(close_file)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULFileSystem>())).read_from_file as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ULFileSystem),
"::",
stringify!(read_from_file)
)
);
}
pub const ULLogLevel_kLogLevel_Error: ULLogLevel = 0;
pub const ULLogLevel_kLogLevel_Warning: ULLogLevel = 1;
pub const ULLogLevel_kLogLevel_Info: ULLogLevel = 2;
#[doc = " Logger"]
pub type ULLogLevel = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " The callback invoked when the library wants to print a message to the log."]
#[doc = ""]
pub type ULLoggerLogMessageCallback =
::std::option::Option<unsafe extern "C" fn(log_level: ULLogLevel, message: ULString)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULLogger {
pub log_message: ULLoggerLogMessageCallback,
}
#[test]
fn bindgen_test_layout_ULLogger() {
assert_eq!(
::std::mem::size_of::<ULLogger>(),
8usize,
concat!("Size of: ", stringify!(ULLogger))
);
assert_eq!(
::std::mem::align_of::<ULLogger>(),
8usize,
concat!("Alignment of ", stringify!(ULLogger))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULLogger>())).log_message as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULLogger),
"::",
stringify!(log_message)
)
);
}
#[doc = ""]
#[doc = " Render buffer description."]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULRenderBuffer {
pub texture_id: ::std::os::raw::c_uint,
pub width: ::std::os::raw::c_uint,
pub height: ::std::os::raw::c_uint,
pub has_stencil_buffer: bool,
pub has_depth_buffer: bool,
}
#[test]
fn bindgen_test_layout_ULRenderBuffer() {
assert_eq!(
::std::mem::size_of::<ULRenderBuffer>(),
16usize,
concat!("Size of: ", stringify!(ULRenderBuffer))
);
assert_eq!(
::std::mem::align_of::<ULRenderBuffer>(),
4usize,
concat!("Alignment of ", stringify!(ULRenderBuffer))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderBuffer>())).texture_id as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULRenderBuffer),
"::",
stringify!(texture_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderBuffer>())).width as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULRenderBuffer),
"::",
stringify!(width)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderBuffer>())).height as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULRenderBuffer),
"::",
stringify!(height)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULRenderBuffer>())).has_stencil_buffer as *const _ as usize
},
12usize,
concat!(
"Offset of field: ",
stringify!(ULRenderBuffer),
"::",
stringify!(has_stencil_buffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULRenderBuffer>())).has_depth_buffer as *const _ as usize },
13usize,
concat!(
"Offset of field: ",
stringify!(ULRenderBuffer),
"::",
stringify!(has_depth_buffer)
)
);
}
#[doc = ""]
#[doc = " Vertex layout for path vertices."]
#[doc = ""]
#[doc = " (this struct's members aligned on single-byte boundaries)"]
#[doc = ""]
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ULVertex_2f_4ub_2f {
pub pos: [f32; 2usize],
pub color: [::std::os::raw::c_uchar; 4usize],
pub obj: [f32; 2usize],
}
#[test]
fn bindgen_test_layout_ULVertex_2f_4ub_2f() {
assert_eq!(
::std::mem::size_of::<ULVertex_2f_4ub_2f>(),
20usize,
concat!("Size of: ", stringify!(ULVertex_2f_4ub_2f))
);
assert_eq!(
::std::mem::align_of::<ULVertex_2f_4ub_2f>(),
1usize,
concat!("Alignment of ", stringify!(ULVertex_2f_4ub_2f))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f>())).pos as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f),
"::",
stringify!(pos)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f>())).color as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f),
"::",
stringify!(color)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f>())).obj as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f),
"::",
stringify!(obj)
)
);
}
#[doc = ""]
#[doc = " Vertex layout for quad vertices."]
#[doc = ""]
#[doc = " (this struct's members aligned on single-byte boundaries)"]
#[doc = ""]
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ULVertex_2f_4ub_2f_2f_28f {
pub pos: [f32; 2usize],
pub color: [::std::os::raw::c_uchar; 4usize],
pub tex: [f32; 2usize],
pub obj: [f32; 2usize],
pub data0: [f32; 4usize],
pub data1: [f32; 4usize],
pub data2: [f32; 4usize],
pub data3: [f32; 4usize],
pub data4: [f32; 4usize],
pub data5: [f32; 4usize],
pub data6: [f32; 4usize],
}
#[test]
fn bindgen_test_layout_ULVertex_2f_4ub_2f_2f_28f() {
assert_eq!(
::std::mem::size_of::<ULVertex_2f_4ub_2f_2f_28f>(),
140usize,
concat!("Size of: ", stringify!(ULVertex_2f_4ub_2f_2f_28f))
);
assert_eq!(
::std::mem::align_of::<ULVertex_2f_4ub_2f_2f_28f>(),
1usize,
concat!("Alignment of ", stringify!(ULVertex_2f_4ub_2f_2f_28f))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).pos as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(pos)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).color as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(color)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).tex as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(tex)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).obj as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(obj)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data0 as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data0)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data1 as *const _ as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data1)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data2 as *const _ as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data3 as *const _ as usize },
76usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data3)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data4 as *const _ as usize },
92usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data4)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data5 as *const _ as usize },
108usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data5)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertex_2f_4ub_2f_2f_28f>())).data6 as *const _ as usize },
124usize,
concat!(
"Offset of field: ",
stringify!(ULVertex_2f_4ub_2f_2f_28f),
"::",
stringify!(data6)
)
);
}
pub const ULVertexBufferFormat_kVertexBufferFormat_2f_4ub_2f: ULVertexBufferFormat = 0;
pub const ULVertexBufferFormat_kVertexBufferFormat_2f_4ub_2f_2f_28f: ULVertexBufferFormat = 1;
#[doc = ""]
#[doc = " Vertex formats."]
#[doc = ""]
pub type ULVertexBufferFormat = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Vertex buffer data."]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULVertexBuffer {
pub format: ULVertexBufferFormat,
pub size: ::std::os::raw::c_uint,
pub data: *mut ::std::os::raw::c_uchar,
}
#[test]
fn bindgen_test_layout_ULVertexBuffer() {
assert_eq!(
::std::mem::size_of::<ULVertexBuffer>(),
16usize,
concat!("Size of: ", stringify!(ULVertexBuffer))
);
assert_eq!(
::std::mem::align_of::<ULVertexBuffer>(),
8usize,
concat!("Alignment of ", stringify!(ULVertexBuffer))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertexBuffer>())).format as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULVertexBuffer),
"::",
stringify!(format)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertexBuffer>())).size as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULVertexBuffer),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULVertexBuffer>())).data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULVertexBuffer),
"::",
stringify!(data)
)
);
}
#[doc = ""]
#[doc = " Vertex index type."]
#[doc = ""]
pub type ULIndexType = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Vertex index buffer data."]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULIndexBuffer {
pub size: ::std::os::raw::c_uint,
pub data: *mut ::std::os::raw::c_uchar,
}
#[test]
fn bindgen_test_layout_ULIndexBuffer() {
assert_eq!(
::std::mem::size_of::<ULIndexBuffer>(),
16usize,
concat!("Size of: ", stringify!(ULIndexBuffer))
);
assert_eq!(
::std::mem::align_of::<ULIndexBuffer>(),
8usize,
concat!("Alignment of ", stringify!(ULIndexBuffer))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIndexBuffer>())).size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULIndexBuffer),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULIndexBuffer>())).data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULIndexBuffer),
"::",
stringify!(data)
)
);
}
pub const ULShaderType_kShaderType_Fill: ULShaderType = 0;
pub const ULShaderType_kShaderType_FillPath: ULShaderType = 1;
#[doc = ""]
#[doc = " Shader types, used with ULGPUState::shader_type"]
#[doc = ""]
#[doc = " Each of these correspond to a vertex/pixel shader pair. You can find"]
#[doc = " stock shader code for these in the `shaders` folder of the AppCore repo."]
#[doc = ""]
pub type ULShaderType = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Raw 4x4 matrix as an array of floats"]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULMatrix4x4 {
pub data: [f32; 16usize],
}
#[test]
fn bindgen_test_layout_ULMatrix4x4() {
assert_eq!(
::std::mem::size_of::<ULMatrix4x4>(),
64usize,
concat!("Size of: ", stringify!(ULMatrix4x4))
);
assert_eq!(
::std::mem::align_of::<ULMatrix4x4>(),
4usize,
concat!("Alignment of ", stringify!(ULMatrix4x4))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULMatrix4x4>())).data as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULMatrix4x4),
"::",
stringify!(data)
)
);
}
#[doc = ""]
#[doc = " 4-component float vector"]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULvec4 {
pub value: [f32; 4usize],
}
#[test]
fn bindgen_test_layout_ULvec4() {
assert_eq!(
::std::mem::size_of::<ULvec4>(),
16usize,
concat!("Size of: ", stringify!(ULvec4))
);
assert_eq!(
::std::mem::align_of::<ULvec4>(),
4usize,
concat!("Alignment of ", stringify!(ULvec4))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULvec4>())).value as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULvec4),
"::",
stringify!(value)
)
);
}
#[doc = ""]
#[doc = " GPU State description."]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULGPUState {
#[doc = " Viewport width in pixels"]
pub viewport_width: ::std::os::raw::c_uint,
#[doc = " Viewport height in pixels"]
pub viewport_height: ::std::os::raw::c_uint,
#[doc = " Transform matrix-- you should multiply this with the screen-space"]
#[doc = " orthographic projection matrix then pass to the vertex shader."]
pub transform: ULMatrix4x4,
#[doc = " Whether or not we should enable texturing for the current draw command."]
pub enable_texturing: bool,
#[doc = " Whether or not we should enable blending for the current draw command."]
#[doc = " If blending is disabled, any drawn pixels should overwrite existing."]
#[doc = " Mainly used so we can modify alpha values of the RenderBuffer during"]
#[doc = " scissored clears."]
pub enable_blend: bool,
#[doc = " The vertex/pixel shader program pair to use for the current draw command."]
#[doc = " You should cast this to ShaderType to get the corresponding enum."]
pub shader_type: ::std::os::raw::c_uchar,
#[doc = " The render buffer to use for the current draw command."]
pub render_buffer_id: ::std::os::raw::c_uint,
#[doc = " The texture id to bind to slot #1. (Will be 0 if none)"]
pub texture_1_id: ::std::os::raw::c_uint,
#[doc = " The texture id to bind to slot #2. (Will be 0 if none)"]
pub texture_2_id: ::std::os::raw::c_uint,
#[doc = " The texture id to bind to slot #3. (Will be 0 if none)"]
pub texture_3_id: ::std::os::raw::c_uint,
#[doc = " The following four members are passed to the pixel shader via uniforms."]
pub uniform_scalar: [f32; 8usize],
pub uniform_vector: [ULvec4; 8usize],
pub clip_size: ::std::os::raw::c_uchar,
pub clip: [ULMatrix4x4; 8usize],
#[doc = " Whether or not scissor testing should be used for the current draw"]
#[doc = " command."]
pub enable_scissor: bool,
#[doc = " The scissor rect to use for scissor testing (units in pixels)"]
pub scissor_rect: ULIntRect,
}
#[test]
fn bindgen_test_layout_ULGPUState() {
assert_eq!(
::std::mem::size_of::<ULGPUState>(),
788usize,
concat!("Size of: ", stringify!(ULGPUState))
);
assert_eq!(
::std::mem::align_of::<ULGPUState>(),
4usize,
concat!("Alignment of ", stringify!(ULGPUState))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).viewport_width as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(viewport_width)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).viewport_height as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(viewport_height)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).transform as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(transform)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).enable_texturing as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(enable_texturing)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).enable_blend as *const _ as usize },
73usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(enable_blend)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).shader_type as *const _ as usize },
74usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(shader_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).render_buffer_id as *const _ as usize },
76usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(render_buffer_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).texture_1_id as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(texture_1_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).texture_2_id as *const _ as usize },
84usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(texture_2_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).texture_3_id as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(texture_3_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).uniform_scalar as *const _ as usize },
92usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(uniform_scalar)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).uniform_vector as *const _ as usize },
124usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(uniform_vector)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).clip_size as *const _ as usize },
252usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(clip_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).clip as *const _ as usize },
256usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(clip)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).enable_scissor as *const _ as usize },
768usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(enable_scissor)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUState>())).scissor_rect as *const _ as usize },
772usize,
concat!(
"Offset of field: ",
stringify!(ULGPUState),
"::",
stringify!(scissor_rect)
)
);
}
pub const ULCommandType_kCommandType_ClearRenderBuffer: ULCommandType = 0;
pub const ULCommandType_kCommandType_DrawGeometry: ULCommandType = 1;
#[doc = ""]
#[doc = " Command types, used with ULCommand::command_type"]
#[doc = ""]
pub type ULCommandType = ::std::os::raw::c_uint;
#[doc = ""]
#[doc = " Command description."]
#[doc = ""]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULCommand {
pub command_type: ::std::os::raw::c_uchar,
pub gpu_state: ULGPUState,
#[doc = " The following members are only used with kCommandType_DrawGeometry"]
pub geometry_id: ::std::os::raw::c_uint,
pub indices_count: ::std::os::raw::c_uint,
pub indices_offset: ::std::os::raw::c_uint,
}
#[test]
fn bindgen_test_layout_ULCommand() {
assert_eq!(
::std::mem::size_of::<ULCommand>(),
804usize,
concat!("Size of: ", stringify!(ULCommand))
);
assert_eq!(
::std::mem::align_of::<ULCommand>(),
4usize,
concat!("Alignment of ", stringify!(ULCommand))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommand>())).command_type as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULCommand),
"::",
stringify!(command_type)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommand>())).gpu_state as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ULCommand),
"::",
stringify!(gpu_state)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommand>())).geometry_id as *const _ as usize },
792usize,
concat!(
"Offset of field: ",
stringify!(ULCommand),
"::",
stringify!(geometry_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommand>())).indices_count as *const _ as usize },
796usize,
concat!(
"Offset of field: ",
stringify!(ULCommand),
"::",
stringify!(indices_count)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommand>())).indices_offset as *const _ as usize },
800usize,
concat!(
"Offset of field: ",
stringify!(ULCommand),
"::",
stringify!(indices_offset)
)
);
}
#[doc = ""]
#[doc = " Command list, @see ULGPUDriverUpdateCommandList"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULCommandList {
pub size: ::std::os::raw::c_uint,
pub commands: *mut ULCommand,
}
#[test]
fn bindgen_test_layout_ULCommandList() {
assert_eq!(
::std::mem::size_of::<ULCommandList>(),
16usize,
concat!("Size of: ", stringify!(ULCommandList))
);
assert_eq!(
::std::mem::align_of::<ULCommandList>(),
8usize,
concat!("Alignment of ", stringify!(ULCommandList))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommandList>())).size as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULCommandList),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULCommandList>())).commands as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULCommandList),
"::",
stringify!(commands)
)
);
}
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver will begin dispatching commands"]
#[doc = " (such as CreateTexture and UpdateCommandList) during the current call to"]
#[doc = " ulRender()."]
#[doc = ""]
pub type ULGPUDriverBeginSynchronizeCallback = ::std::option::Option<unsafe extern "C" fn()>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver has finished dispatching commands."]
#[doc = " during the current call to ulRender()."]
#[doc = ""]
pub type ULGPUDriverEndSynchronizeCallback = ::std::option::Option<unsafe extern "C" fn()>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to get the next available"]
#[doc = " texture ID."]
#[doc = ""]
pub type ULGPUDriverNextTextureIdCallback =
::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_uint>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to create a texture with a"]
#[doc = " certain ID and optional bitmap."]
#[doc = ""]
#[doc = " **NOTE**: If the Bitmap is empty (ulBitmapIsEmpty), then a RTT Texture"]
#[doc = " should be created instead. This will be used as a backing"]
#[doc = " texture for a new RenderBuffer."]
#[doc = ""]
pub type ULGPUDriverCreateTextureCallback = ::std::option::Option<
unsafe extern "C" fn(texture_id: ::std::os::raw::c_uint, bitmap: ULBitmap),
>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to update an existing non-RTT"]
#[doc = " texture with new bitmap data."]
#[doc = ""]
pub type ULGPUDriverUpdateTextureCallback = ::std::option::Option<
unsafe extern "C" fn(texture_id: ::std::os::raw::c_uint, bitmap: ULBitmap),
>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to destroy a texture."]
#[doc = ""]
pub type ULGPUDriverDestroyTextureCallback =
::std::option::Option<unsafe extern "C" fn(texture_id: ::std::os::raw::c_uint)>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to generate the next"]
#[doc = " available render buffer ID."]
#[doc = ""]
pub type ULGPUDriverNextRenderBufferIdCallback =
::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_uint>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to create a render buffer"]
#[doc = " with certain ID and buffer description."]
#[doc = ""]
pub type ULGPUDriverCreateRenderBufferCallback = ::std::option::Option<
unsafe extern "C" fn(render_buffer_id: ::std::os::raw::c_uint, buffer: ULRenderBuffer),
>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to destroy a render buffer"]
#[doc = ""]
pub type ULGPUDriverDestroyRenderBufferCallback =
::std::option::Option<unsafe extern "C" fn(render_buffer_id: ::std::os::raw::c_uint)>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to generate the next"]
#[doc = " available geometry ID."]
#[doc = ""]
pub type ULGPUDriverNextGeometryIdCallback =
::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_uint>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to create geometry with"]
#[doc = " certain ID and vertex/index data."]
#[doc = ""]
pub type ULGPUDriverCreateGeometryCallback = ::std::option::Option<
unsafe extern "C" fn(
geometry_id: ::std::os::raw::c_uint,
vertices: ULVertexBuffer,
indices: ULIndexBuffer,
),
>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to update existing geometry"]
#[doc = " with new vertex/index data."]
#[doc = ""]
pub type ULGPUDriverUpdateGeometryCallback = ::std::option::Option<
unsafe extern "C" fn(
geometry_id: ::std::os::raw::c_uint,
vertices: ULVertexBuffer,
indices: ULIndexBuffer,
),
>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to destroy geometry."]
#[doc = ""]
pub type ULGPUDriverDestroyGeometryCallback =
::std::option::Option<unsafe extern "C" fn(geometry_id: ::std::os::raw::c_uint)>;
#[doc = ""]
#[doc = " The callback invoked when the GPUDriver wants to update the command list"]
#[doc = " (you should copy the commands to your own structure)."]
#[doc = ""]
pub type ULGPUDriverUpdateCommandListCallback =
::std::option::Option<unsafe extern "C" fn(list: ULCommandList)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULGPUDriver {
pub begin_synchronize: ULGPUDriverBeginSynchronizeCallback,
pub end_synchronize: ULGPUDriverEndSynchronizeCallback,
pub next_texture_id: ULGPUDriverNextTextureIdCallback,
pub create_texture: ULGPUDriverCreateTextureCallback,
pub update_texture: ULGPUDriverUpdateTextureCallback,
pub destroy_texture: ULGPUDriverDestroyTextureCallback,
pub next_render_buffer_id: ULGPUDriverNextRenderBufferIdCallback,
pub create_render_buffer: ULGPUDriverCreateRenderBufferCallback,
pub destroy_render_buffer: ULGPUDriverDestroyRenderBufferCallback,
pub next_geometry_id: ULGPUDriverNextGeometryIdCallback,
pub create_geometry: ULGPUDriverCreateGeometryCallback,
pub update_geometry: ULGPUDriverUpdateGeometryCallback,
pub destroy_geometry: ULGPUDriverDestroyGeometryCallback,
pub update_command_list: ULGPUDriverUpdateCommandListCallback,
}
#[test]
fn bindgen_test_layout_ULGPUDriver() {
assert_eq!(
::std::mem::size_of::<ULGPUDriver>(),
112usize,
concat!("Size of: ", stringify!(ULGPUDriver))
);
assert_eq!(
::std::mem::align_of::<ULGPUDriver>(),
8usize,
concat!("Alignment of ", stringify!(ULGPUDriver))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).begin_synchronize as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(begin_synchronize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).end_synchronize as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(end_synchronize)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).next_texture_id as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(next_texture_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).create_texture as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(create_texture)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).update_texture as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(update_texture)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).destroy_texture as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(destroy_texture)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULGPUDriver>())).next_render_buffer_id as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(next_render_buffer_id)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULGPUDriver>())).create_render_buffer as *const _ as usize
},
56usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(create_render_buffer)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ULGPUDriver>())).destroy_render_buffer as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(destroy_render_buffer)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).next_geometry_id as *const _ as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(next_geometry_id)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).create_geometry as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(create_geometry)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).update_geometry as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(update_geometry)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).destroy_geometry as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(destroy_geometry)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULGPUDriver>())).update_command_list as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(ULGPUDriver),
"::",
stringify!(update_command_list)
)
);
}
extern "C" {
#[doc = ""]
#[doc = " Sets up an orthographic projection matrix with a certain viewport width"]
#[doc = " and height, multiplies it by 'transform', and returns the result."]
#[doc = ""]
#[doc = " This should be used to calculate the model-view projection matrix for the"]
#[doc = " vertex shaders using the current ULGPUState."]
#[doc = ""]
#[doc = " The 'flip_y' can be optionally used to flip the Y coordinate-space."]
#[doc = " (Usually flip_y == true for OpenGL)"]
#[doc = ""]
pub fn ulApplyProjection(
transform: ULMatrix4x4,
viewport_width: f32,
viewport_height: f32,
flip_y: bool,
) -> ULMatrix4x4;
}
#[doc = ""]
#[doc = " The callback invoked when the library wants to clear the system's"]
#[doc = " clipboard."]
#[doc = ""]
pub type ULClipboardClearCallback = ::std::option::Option<unsafe extern "C" fn()>;
#[doc = ""]
#[doc = " The callback invoked when the library wants to read from the system's"]
#[doc = " clipboard."]
#[doc = ""]
#[doc = " You should store the result (if any) in 'result'."]
#[doc = ""]
pub type ULClipboardReadPlainTextCallback =
::std::option::Option<unsafe extern "C" fn(result: ULString)>;
#[doc = ""]
#[doc = " The callback invoked when the library wants to write to the system's"]
#[doc = " clipboard."]
#[doc = ""]
pub type ULClipboardWritePlainTextCallback =
::std::option::Option<unsafe extern "C" fn(text: ULString)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ULClipboard {
pub clear: ULClipboardClearCallback,
pub read_plain_text: ULClipboardReadPlainTextCallback,
pub write_plain_text: ULClipboardWritePlainTextCallback,
}
#[test]
fn bindgen_test_layout_ULClipboard() {
assert_eq!(
::std::mem::size_of::<ULClipboard>(),
24usize,
concat!("Size of: ", stringify!(ULClipboard))
);
assert_eq!(
::std::mem::align_of::<ULClipboard>(),
8usize,
concat!("Alignment of ", stringify!(ULClipboard))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULClipboard>())).clear as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ULClipboard),
"::",
stringify!(clear)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULClipboard>())).read_plain_text as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ULClipboard),
"::",
stringify!(read_plain_text)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ULClipboard>())).write_plain_text as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ULClipboard),
"::",
stringify!(write_plain_text)
)
);
}
extern "C" {
#[doc = ""]
#[doc = " Set a custom Logger implementation."]
#[doc = ""]
#[doc = " This is used to log debug messages to the console or to a log file."]
#[doc = ""]
#[doc = " You should call this before ulCreateRenderer() or ulCreateApp()."]
#[doc = ""]
#[doc = " @note ulCreateApp() will use the default logger if you never call this."]
#[doc = ""]
#[doc = " @note If you're not using ulCreateApp(), (eg, using ulCreateRenderer())"]
#[doc = " you can still use the default logger by calling"]
#[doc = " ulEnableDefaultLogger() (@see <AppCore/CAPI.h>)"]
#[doc = ""]
pub fn ulPlatformSetLogger(logger: ULLogger);
}
extern "C" {
#[doc = ""]
#[doc = " Set a custom FileSystem implementation."]
#[doc = ""]
#[doc = " This is used for loading File URLs (eg, <file:///page.html>). If you don't"]
#[doc = " call this, and are not using ulCreateApp() or ulEnablePlatformFileSystem(),"]
#[doc = " you will not be able to load any File URLs."]
#[doc = ""]
#[doc = " You should call this before ulCreateRenderer() or ulCreateApp()."]
#[doc = ""]
#[doc = " @note ulCreateApp() will use the default platform file system if you never"]
#[doc = " call this."]
#[doc = ""]
#[doc = " @note If you're not using ulCreateApp(), (eg, using ulCreateRenderer())"]
#[doc = " you can still use the default platform file system by calling"]
#[doc = " ulEnablePlatformFileSystem() (@see <AppCore/CAPI.h>)"]
#[doc = ""]
pub fn ulPlatformSetFileSystem(file_system: ULFileSystem);
}
extern "C" {
#[doc = ""]
#[doc = " Set a custom Surface implementation."]
#[doc = ""]
#[doc = " This can be used to wrap a platform-specific GPU texture, Windows DIB,"]
#[doc = " macOS CGImage, or any other pixel buffer target for display on screen."]
#[doc = ""]
#[doc = " By default, the library uses a bitmap surface for all surfaces but you can"]
#[doc = " override this by providing your own surface definition here."]
#[doc = ""]
#[doc = " You should call this before ulCreateRenderer() or ulCreateApp()."]
#[doc = ""]
pub fn ulPlatformSetSurfaceDefinition(surface_definition: ULSurfaceDefinition);
}
extern "C" {
#[doc = ""]
#[doc = " Set a custom GPUDriver implementation."]
#[doc = ""]
#[doc = " This should be used if you have enabled the GPU renderer in the Config and"]
#[doc = " are using ulCreateRenderer() (which does not provide its own GPUDriver"]
#[doc = " implementation)."]
#[doc = ""]
#[doc = " The GPUDriver interface is used by the library to dispatch GPU calls to"]
#[doc = " your native GPU context (eg, D3D11, Metal, OpenGL, Vulkan, etc.) There"]
#[doc = " are reference implementations for this interface in the AppCore repo."]
#[doc = ""]
#[doc = " You should call this before ulCreateRenderer()."]
#[doc = ""]
pub fn ulPlatformSetGPUDriver(gpu_driver: ULGPUDriver);
}
extern "C" {
#[doc = ""]
#[doc = " Set a custom Clipboard implementation."]
#[doc = ""]
#[doc = " This should be used if you are using ulCreateRenderer() (which does not"]
#[doc = " provide its own clipboard implementation)."]
#[doc = ""]
#[doc = " The Clipboard interface is used by the library to make calls to the"]
#[doc = " system's native clipboard (eg, cut, copy, paste)."]
#[doc = ""]
#[doc = " You should call this before ulCreateRenderer()."]
#[doc = ""]
pub fn ulPlatformSetClipboard(clipboard: ULClipboard);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Settings {
_unused: [u8; 0],
}
pub type ULSettings = *mut C_Settings;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_App {
_unused: [u8; 0],
}
pub type ULApp = *mut C_App;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Window {
_unused: [u8; 0],
}
pub type ULWindow = *mut C_Window;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Monitor {
_unused: [u8; 0],
}
pub type ULMonitor = *mut C_Monitor;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct C_Overlay {
_unused: [u8; 0],
}
pub type ULOverlay = *mut C_Overlay;
pub const ULWindowFlags_kWindowFlags_Borderless: ULWindowFlags = 1;
pub const ULWindowFlags_kWindowFlags_Titled: ULWindowFlags = 2;
pub const ULWindowFlags_kWindowFlags_Resizable: ULWindowFlags = 4;
pub const ULWindowFlags_kWindowFlags_Maximizable: ULWindowFlags = 8;
#[doc = ""]
#[doc = " Window creation flags. @see Window::Create"]
#[doc = ""]
pub type ULWindowFlags = ::std::os::raw::c_uint;
extern "C" {
#[doc = ""]
#[doc = " Create settings with default values (see <AppCore/App.h>)."]
#[doc = ""]
pub fn ulCreateSettings() -> ULSettings;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy settings."]
#[doc = ""]
pub fn ulDestroySettings(settings: ULSettings);
}
extern "C" {
#[doc = ""]
#[doc = " Set the name of the developer of this app."]
#[doc = ""]
#[doc = " This is used to generate a unique path to store local application data"]
#[doc = " on the user's machine."]
#[doc = ""]
#[doc = " Default is \"MyCompany\""]
#[doc = ""]
pub fn ulSettingsSetDeveloperName(settings: ULSettings, name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set the name of this app."]
#[doc = ""]
#[doc = " This is used to generate a unique path to store local application data"]
#[doc = " on the user's machine."]
#[doc = ""]
#[doc = " Default is \"MyApp\""]
#[doc = ""]
pub fn ulSettingsSetAppName(settings: ULSettings, name: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set the root file path for our file system, you should set this to the"]
#[doc = " relative path where all of your app data is."]
#[doc = ""]
#[doc = " This will be used to resolve all file URLs, eg file:///page.html"]
#[doc = ""]
#[doc = " @note The default path is \"./assets/\""]
#[doc = ""]
#[doc = " This relative path is resolved using the following logic:"]
#[doc = " - Windows: relative to the executable path"]
#[doc = " - Linux: relative to the executable path"]
#[doc = " - macOS: relative to YourApp.app/Contents/Resources/"]
#[doc = ""]
pub fn ulSettingsSetFileSystemPath(settings: ULSettings, path: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " Set whether or not we should load and compile shaders from the file system"]
#[doc = " (eg, from the /shaders/ path, relative to file_system_path)."]
#[doc = ""]
#[doc = " If this is false (the default), we will instead load pre-compiled shaders"]
#[doc = " from memory which speeds up application startup time."]
#[doc = ""]
pub fn ulSettingsSetLoadShadersFromFileSystem(settings: ULSettings, enabled: bool);
}
extern "C" {
#[doc = ""]
#[doc = " We try to use the GPU renderer when a compatible GPU is detected."]
#[doc = ""]
#[doc = " Set this to true to force the engine to always use the CPU renderer."]
#[doc = ""]
pub fn ulSettingsSetForceCPURenderer(settings: ULSettings, force_cpu: bool);
}
extern "C" {
#[doc = ""]
#[doc = " Create the App singleton."]
#[doc = ""]
#[doc = " @param settings Settings to customize App runtime behavior. You can pass"]
#[doc = " NULL for this parameter to use default settings."]
#[doc = ""]
#[doc = " @param config Config options for the Ultralight renderer. You can pass"]
#[doc = " NULL for this parameter to use default config."]
#[doc = ""]
#[doc = " @note You should only create one of these per application lifetime."]
#[doc = ""]
#[doc = " @note Certain Config options may be overridden during App creation,"]
#[doc = " most commonly Config::face_winding and Config::device_scale_hint."]
#[doc = ""]
pub fn ulCreateApp(settings: ULSettings, config: ULConfig) -> ULApp;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy the App instance."]
#[doc = ""]
pub fn ulDestroyApp(app: ULApp);
}
extern "C" {
#[doc = ""]
#[doc = " Set the main window, you must set this before calling ulAppRun."]
#[doc = ""]
#[doc = " @param window The window to use for all rendering."]
#[doc = ""]
#[doc = " @note We currently only support one Window per App, this will change"]
#[doc = " later once we add support for multiple driver instances."]
#[doc = ""]
pub fn ulAppSetWindow(app: ULApp, window: ULWindow);
}
extern "C" {
#[doc = ""]
#[doc = " Get the main window."]
#[doc = ""]
pub fn ulAppGetWindow(app: ULApp) -> ULWindow;
}
pub type ULUpdateCallback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>;
extern "C" {
#[doc = ""]
#[doc = " Set a callback for whenever the App updates. You should update all app"]
#[doc = " logic here."]
#[doc = ""]
#[doc = " @note This event is fired right before the run loop calls"]
#[doc = " Renderer::Update and Renderer::Render."]
#[doc = ""]
pub fn ulAppSetUpdateCallback(
app: ULApp,
callback: ULUpdateCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not the App is running."]
#[doc = ""]
pub fn ulAppIsRunning(app: ULApp) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Get the main monitor (this is never NULL)."]
#[doc = ""]
#[doc = " @note We'll add monitor enumeration later."]
#[doc = ""]
pub fn ulAppGetMainMonitor(app: ULApp) -> ULMonitor;
}
extern "C" {
#[doc = ""]
#[doc = " Get the underlying Renderer instance."]
#[doc = ""]
pub fn ulAppGetRenderer(app: ULApp) -> ULRenderer;
}
extern "C" {
#[doc = ""]
#[doc = " Run the main loop, make sure to call ulAppSetWindow before calling this."]
#[doc = ""]
pub fn ulAppRun(app: ULApp);
}
extern "C" {
#[doc = ""]
#[doc = " Quit the application."]
#[doc = ""]
pub fn ulAppQuit(app: ULApp);
}
extern "C" {
#[doc = ""]
#[doc = " Get the monitor's DPI scale (1.0 = 100%)."]
#[doc = ""]
pub fn ulMonitorGetScale(monitor: ULMonitor) -> f64;
}
extern "C" {
#[doc = ""]
#[doc = " Get the width of the monitor (in pixels)."]
#[doc = ""]
pub fn ulMonitorGetWidth(monitor: ULMonitor) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the height of the monitor (in pixels)."]
#[doc = ""]
pub fn ulMonitorGetHeight(monitor: ULMonitor) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Create a new Window."]
#[doc = ""]
#[doc = " @param monitor The monitor to create the Window on."]
#[doc = ""]
#[doc = " @param width The width (in device coordinates)."]
#[doc = ""]
#[doc = " @param height The height (in device coordinates)."]
#[doc = ""]
#[doc = " @param fullscreen Whether or not the window is fullscreen."]
#[doc = ""]
#[doc = " @param window_flags Various window flags."]
#[doc = ""]
pub fn ulCreateWindow(
monitor: ULMonitor,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
fullscreen: bool,
window_flags: ::std::os::raw::c_uint,
) -> ULWindow;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy a Window."]
#[doc = ""]
pub fn ulDestroyWindow(window: ULWindow);
}
pub type ULCloseCallback =
::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>;
extern "C" {
#[doc = ""]
#[doc = " Set a callback to be notified when a window closes."]
#[doc = ""]
pub fn ulWindowSetCloseCallback(
window: ULWindow,
callback: ULCloseCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
pub type ULResizeCallback = ::std::option::Option<
unsafe extern "C" fn(
user_data: *mut ::std::os::raw::c_void,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
),
>;
extern "C" {
#[doc = ""]
#[doc = " Set a callback to be notified when a window resizes"]
#[doc = " (parameters are passed back in pixels)."]
#[doc = ""]
pub fn ulWindowSetResizeCallback(
window: ULWindow,
callback: ULResizeCallback,
user_data: *mut ::std::os::raw::c_void,
);
}
extern "C" {
#[doc = ""]
#[doc = " Get window width (in pixels)."]
#[doc = ""]
pub fn ulWindowGetWidth(window: ULWindow) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get window height (in pixels)."]
#[doc = ""]
pub fn ulWindowGetHeight(window: ULWindow) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get whether or not a window is fullscreen."]
#[doc = ""]
pub fn ulWindowIsFullscreen(window: ULWindow) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Get the DPI scale of a window."]
#[doc = ""]
pub fn ulWindowGetScale(window: ULWindow) -> f64;
}
extern "C" {
#[doc = ""]
#[doc = " Set the window title."]
#[doc = ""]
pub fn ulWindowSetTitle(window: ULWindow, title: *const ::std::os::raw::c_char);
}
extern "C" {
#[doc = ""]
#[doc = " Set the cursor for a window."]
#[doc = ""]
pub fn ulWindowSetCursor(window: ULWindow, cursor: ULCursor);
}
extern "C" {
#[doc = ""]
#[doc = " Close a window."]
#[doc = ""]
pub fn ulWindowClose(window: ULWindow);
}
extern "C" {
#[doc = ""]
#[doc = " Convert device coordinates to pixels using the current DPI scale."]
#[doc = ""]
pub fn ulWindowDeviceToPixel(
window: ULWindow,
val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = ""]
#[doc = " Convert pixels to device coordinates using the current DPI scale."]
#[doc = ""]
pub fn ulWindowPixelsToDevice(
window: ULWindow,
val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = ""]
#[doc = " Get the underlying native window handle."]
#[doc = ""]
#[doc = " @note This is: - HWND on Windows"]
#[doc = " - NSWindow* on macOS"]
#[doc = " - GLFWwindow* on Linux"]
#[doc = ""]
pub fn ulWindowGetNativeHandle(window: ULWindow) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = ""]
#[doc = " Create a new Overlay."]
#[doc = ""]
#[doc = " @param window The window to create the Overlay in. (we currently only"]
#[doc = " support one window per application)"]
#[doc = ""]
#[doc = " @param width The width in device coordinates."]
#[doc = ""]
#[doc = " @param height The height in device coordinates."]
#[doc = ""]
#[doc = " @param x The x-position (offset from the left of the Window), in"]
#[doc = " pixels."]
#[doc = ""]
#[doc = " @param y The y-position (offset from the top of the Window), in"]
#[doc = " pixels."]
#[doc = ""]
#[doc = " @note Each Overlay is essentially a View and an on-screen quad. You should"]
#[doc = " create the Overlay then load content into the underlying View."]
#[doc = ""]
pub fn ulCreateOverlay(
window: ULWindow,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> ULOverlay;
}
extern "C" {
#[doc = ""]
#[doc = " Create a new Overlay, wrapping an existing View."]
#[doc = ""]
#[doc = " @param window The window to create the Overlay in. (we currently only"]
#[doc = " support one window per application)"]
#[doc = ""]
#[doc = " @param view The View to wrap (will use its width and height)."]
#[doc = ""]
#[doc = " @param x The x-position (offset from the left of the Window), in"]
#[doc = " pixels."]
#[doc = ""]
#[doc = " @param y The y-position (offset from the top of the Window), in"]
#[doc = " pixels."]
#[doc = ""]
#[doc = " @note Each Overlay is essentially a View and an on-screen quad. You should"]
#[doc = " create the Overlay then load content into the underlying View."]
#[doc = ""]
pub fn ulCreateOverlayWithView(
window: ULWindow,
view: ULView,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> ULOverlay;
}
extern "C" {
#[doc = ""]
#[doc = " Destroy an overlay."]
#[doc = ""]
pub fn ulDestroyOverlay(overlay: ULOverlay);
}
extern "C" {
#[doc = ""]
#[doc = " Get the underlying View."]
#[doc = ""]
pub fn ulOverlayGetView(overlay: ULOverlay) -> ULView;
}
extern "C" {
#[doc = ""]
#[doc = " Get the width (in pixels)."]
#[doc = ""]
pub fn ulOverlayGetWidth(overlay: ULOverlay) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the height (in pixels)."]
#[doc = ""]
pub fn ulOverlayGetHeight(overlay: ULOverlay) -> ::std::os::raw::c_uint;
}
extern "C" {
#[doc = ""]
#[doc = " Get the x-position (offset from the left of the Window), in pixels."]
#[doc = ""]
pub fn ulOverlayGetX(overlay: ULOverlay) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = ""]
#[doc = " Get the y-position (offset from the top of the Window), in pixels."]
#[doc = ""]
pub fn ulOverlayGetY(overlay: ULOverlay) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = ""]
#[doc = " Move the overlay to a new position (in pixels)."]
#[doc = ""]
pub fn ulOverlayMoveTo(overlay: ULOverlay, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int);
}
extern "C" {
#[doc = ""]
#[doc = " Resize the overlay (and underlying View), dimensions should be"]
#[doc = " specified in pixels."]
#[doc = ""]
pub fn ulOverlayResize(
overlay: ULOverlay,
width: ::std::os::raw::c_uint,
height: ::std::os::raw::c_uint,
);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not the overlay is hidden (not drawn)."]
#[doc = ""]
pub fn ulOverlayIsHidden(overlay: ULOverlay) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Hide the overlay (will no longer be drawn)."]
#[doc = ""]
pub fn ulOverlayHide(overlay: ULOverlay);
}
extern "C" {
#[doc = ""]
#[doc = " Show the overlay."]
#[doc = ""]
pub fn ulOverlayShow(overlay: ULOverlay);
}
extern "C" {
#[doc = ""]
#[doc = " Whether or not an overlay has keyboard focus."]
#[doc = ""]
pub fn ulOverlayHasFocus(overlay: ULOverlay) -> bool;
}
extern "C" {
#[doc = ""]
#[doc = " Grant this overlay exclusive keyboard focus."]
#[doc = ""]
pub fn ulOverlayFocus(overlay: ULOverlay);
}
extern "C" {
#[doc = ""]
#[doc = " Remove keyboard focus."]
#[doc = ""]
pub fn ulOverlayUnfocus(overlay: ULOverlay);
}
extern "C" {
#[doc = ""]
#[doc = " This is only needed if you are not calling ulCreateApp()."]
#[doc = ""]
#[doc = " Initializes the platform font loader and sets it as the current FontLoader."]
#[doc = ""]
pub fn ulEnablePlatformFontLoader();
}
extern "C" {
#[doc = ""]
#[doc = " This is only needed if you are not calling ulCreateApp()."]
#[doc = ""]
#[doc = " Initializes the platform file system (needed for loading file:/// URLs) and"]
#[doc = " sets it as the current FileSystem."]
#[doc = ""]
#[doc = " You can specify a base directory path to resolve relative paths against."]
#[doc = ""]
pub fn ulEnablePlatformFileSystem(base_dir: ULString);
}
extern "C" {
#[doc = ""]
#[doc = " This is only needed if you are not calling ulCreateApp()."]
#[doc = ""]
#[doc = " Initializes the default logger (writes the log to a file)."]
#[doc = ""]
#[doc = " You should specify a writable log path to write the log to"]
#[doc = " for example \"./ultralight.log\"."]
#[doc = ""]
pub fn ulEnableDefaultLogger(log_path: ULString);
}