mirror of
https://github.com/tauri-apps/javascriptcore-rs.git
synced 2026-01-31 00:35:17 +01:00
regenerate
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
},
|
||||
"packages": {
|
||||
"javascriptcore-rs-sys": {
|
||||
"path": "./javascriptcore-sys",
|
||||
"path": "./sys",
|
||||
"manager": "rust"
|
||||
},
|
||||
"javascriptcore-rs": {
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,6 +1,6 @@
|
||||
[submodule "gir-files"]
|
||||
path = gir-files
|
||||
url = https://github.com/wusyong/gir-files
|
||||
url = https://github.com/tauri-apps/gir-files
|
||||
[submodule "gir"]
|
||||
path = gir
|
||||
url = https://github.com/gtk-rs/gir
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "javascriptcore-rs"
|
||||
version = "0.15.1"
|
||||
version = "0.15.4"
|
||||
edition = "2018"
|
||||
description = "Rust bindings for the javacriptcore library"
|
||||
repository = "https://github.com/tauri-apps/javascriptcore-rs"
|
||||
@@ -19,8 +19,8 @@ bitflags = "^1.0"
|
||||
|
||||
[dependencies.ffi]
|
||||
package = "javascriptcore-rs-sys"
|
||||
path = "./javascriptcore-sys"
|
||||
version = "0.3.0"
|
||||
path = "./sys"
|
||||
version = "0.3.2"
|
||||
|
||||
[features]
|
||||
v2_28 = [ "ffi/v2_28" ]
|
||||
|
||||
15
Gir.toml
15
Gir.toml
@@ -4,14 +4,11 @@ version = "4.0"
|
||||
target_path = "."
|
||||
min_cfg_version = "2.24"
|
||||
work_mode = "normal"
|
||||
girs_directories = [ "gir-files/" ]
|
||||
girs_directories = ["gir-files/"]
|
||||
deprecate_by_min_version = true
|
||||
single_version_file = true
|
||||
|
||||
external_libraries = [
|
||||
"GLib",
|
||||
"GObject",
|
||||
]
|
||||
external_libraries = ["GLib", "GObject"]
|
||||
|
||||
generate = [
|
||||
"JavaScriptCore.CheckSyntaxMode",
|
||||
@@ -32,7 +29,6 @@ generate = [
|
||||
"JavaScriptCore.PropertyGetter",
|
||||
"JavaScriptCore.PropertySetter",
|
||||
"JavaScriptCore.Setter",
|
||||
"JavaScriptCore.StringRef",
|
||||
"JavaScriptCore.ValuePropertyFlags",
|
||||
"JavaScriptCore.VariadicFunction",
|
||||
"JavaScriptCore.VirtualMachine",
|
||||
@@ -43,6 +39,8 @@ manual = [
|
||||
"GLib.DestroyNotify",
|
||||
"GLib.OptionGroup",
|
||||
"GObject.Callback",
|
||||
"JavaScriptCore.StringRef",
|
||||
"JavaScriptCore.GlobalContextRef",
|
||||
]
|
||||
|
||||
[[object]]
|
||||
@@ -55,8 +53,11 @@ name = "JavaScriptCore.Value"
|
||||
status = "generate"
|
||||
generate_builder = true
|
||||
|
||||
[[object.function]]
|
||||
name = "object_define_property_accessor"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "JavaScriptCore.WeakValue"
|
||||
status = "generate"
|
||||
generate_builder = true
|
||||
|
||||
|
||||
1
generator.py
Symbolic link
1
generator.py
Symbolic link
@@ -0,0 +1 @@
|
||||
gir/generator.py
|
||||
2
gir
2
gir
Submodule gir updated: 05fe12c0b7...a97e6087cf
Submodule gir-files updated: d11622cc2f...7182204ef1
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
@@ -21,7 +21,7 @@ impl Class {
|
||||
//}
|
||||
|
||||
//#[doc(alias = "jsc_class_add_constructor_variadic")]
|
||||
//pub fn add_constructor_variadic<P: Fn() + 'static>(&self, name: Option<&str>, callback: P, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) -> Option<Value> {
|
||||
//pub fn add_constructor_variadic(&self, name: Option<&str>, callback: /*Unimplemented*/Fn(/*Ignored*/glib::PtrArray) -> /*Unimplemented*/Fundamental: Pointer, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) -> Option<Value> {
|
||||
// unsafe { TODO: call ffi:jsc_class_add_constructor_variadic() }
|
||||
//}
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Class {
|
||||
//}
|
||||
|
||||
//#[doc(alias = "jsc_class_add_method_variadic")]
|
||||
//pub fn add_method_variadic<P: Fn() + 'static>(&self, name: &str, callback: P, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) {
|
||||
//pub fn add_method_variadic(&self, name: &str, callback: /*Unimplemented*/Fn(/*Unimplemented*/Fundamental: Pointer, /*Ignored*/glib::PtrArray) -> Value, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) {
|
||||
// unsafe { TODO: call ffi:jsc_class_add_method_variadic() }
|
||||
//}
|
||||
|
||||
@@ -46,7 +46,7 @@ impl Class {
|
||||
//}
|
||||
|
||||
//#[doc(alias = "jsc_class_add_property")]
|
||||
//pub fn add_property(&self, name: &str, property_type: glib::types::Type, getter: Option<Box_<dyn FnOnce() + 'static>>, setter: Option<Box_<dyn Fn() + 'static>>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
|
||||
//pub fn add_property(&self, name: &str, property_type: glib::types::Type, getter: /*Unimplemented*/Fn(/*Unimplemented*/Fundamental: Pointer) -> Value, setter: /*Unimplemented*/Fn(/*Unimplemented*/Fundamental: Pointer, &Value), user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
|
||||
// unsafe { TODO: call ffi:jsc_class_add_property() }
|
||||
//}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{CheckSyntaxMode, CheckSyntaxResult, Exception, Value, VirtualMachine};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Context;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use bitflags::bitflags;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod class;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::{Context, ValuePropertyFlags};
|
||||
@@ -74,7 +74,7 @@ impl Value {
|
||||
//}
|
||||
|
||||
//#[doc(alias = "jsc_value_new_function_variadic")]
|
||||
//pub fn new_function_variadic<P: Fn() + 'static>(context: &impl IsA<Context>, name: Option<&str>, callback: P, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) -> Value {
|
||||
//pub fn new_function_variadic(context: &impl IsA<Context>, name: Option<&str>, callback: /*Unimplemented*/Fn(/*Ignored*/glib::PtrArray) -> Value, user_data: /*Unimplemented*/Option<Fundamental: Pointer>, return_type: glib::types::Type) -> Value {
|
||||
// unsafe { TODO: call ffi:jsc_value_new_function_variadic() }
|
||||
//}
|
||||
|
||||
@@ -226,9 +226,6 @@ pub trait ValueExt: 'static {
|
||||
#[doc(alias = "jsc_value_is_undefined")]
|
||||
fn is_undefined(&self) -> bool;
|
||||
|
||||
//#[doc(alias = "jsc_value_object_define_property_accessor")]
|
||||
//fn object_define_property_accessor(&self, property_name: &str, flags: ValuePropertyFlags, property_type: glib::types::Type, getter: Option<Box_<dyn FnOnce() + 'static>>, setter: Option<Box_<dyn Fn() + 'static>>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>);
|
||||
|
||||
#[doc(alias = "jsc_value_object_define_property_data")]
|
||||
fn object_define_property_data(
|
||||
&self,
|
||||
@@ -364,10 +361,6 @@ impl<O: IsA<Value>> ValueExt for O {
|
||||
unsafe { from_glib(ffi::jsc_value_is_undefined(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
//fn object_define_property_accessor(&self, property_name: &str, flags: ValuePropertyFlags, property_type: glib::types::Type, getter: Option<Box_<dyn FnOnce() + 'static>>, setter: Option<Box_<dyn Fn() + 'static>>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
|
||||
// unsafe { TODO: call ffi:jsc_value_object_define_property_accessor() }
|
||||
//}
|
||||
|
||||
fn object_define_property_data(
|
||||
&self,
|
||||
property_name: &str,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
from gir-files (https://github.com/wusyong/gir-files @ d11622cc2fc4)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/wusyong/gir-files)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Value;
|
||||
|
||||
28
src/global_context_ref.rs
Normal file
28
src/global_context_ref.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use ffi::*;
|
||||
use glib::translate::*;
|
||||
use std::ptr;
|
||||
|
||||
pub struct GlobalContextRef {
|
||||
raw: JSGlobalContextRef,
|
||||
}
|
||||
|
||||
impl FromGlibPtrNone<JSGlobalContextRef> for GlobalContextRef {
|
||||
unsafe fn from_glib_none(ptr: JSGlobalContextRef) -> Self {
|
||||
GlobalContextRef { raw: ptr }
|
||||
}
|
||||
}
|
||||
|
||||
impl FromGlibPtrFull<JSGlobalContextRef> for GlobalContextRef {
|
||||
unsafe fn from_glib_full(ptr: JSGlobalContextRef) -> Self {
|
||||
GlobalContextRef { raw: ptr }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToGlibPtr<'a, JSGlobalContextRef> for GlobalContextRef {
|
||||
type Storage = ();
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none(&self) -> Stash<'a, JSGlobalContextRef, GlobalContextRef> {
|
||||
Stash(self.raw, ())
|
||||
}
|
||||
}
|
||||
15
src/lib.rs
15
src/lib.rs
@@ -1,5 +1,18 @@
|
||||
// // Copyright 2013-2017, The Gtk-rs Project Developers.
|
||||
// // See the COPYRIGHT file at the top-level directory of this distribution.
|
||||
// // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT>
|
||||
#![cfg_attr(feature = "dox", feature(doc_cfg))]
|
||||
|
||||
pub use auto::{traits::*, *};
|
||||
use ffi::*;
|
||||
use glib::translate::{FromGlibPtrFull, FromGlibPtrNone};
|
||||
use std::ptr;
|
||||
|
||||
mod auto;
|
||||
pub use auto::{traits::*, *};
|
||||
mod global_context_ref;
|
||||
mod string_ref;
|
||||
mod value_ref;
|
||||
|
||||
pub use global_context_ref::*;
|
||||
pub use string_ref::*;
|
||||
pub use value_ref::*;
|
||||
|
||||
27
src/string_ref.rs
Normal file
27
src/string_ref.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct StringRef(Shared<ffi::JSStringRef>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| ffi::JSStringRetain(*ptr),
|
||||
unref => |ptr| ffi::JSStringRelease(*ptr),
|
||||
}
|
||||
}
|
||||
|
||||
impl StringRef {
|
||||
#[doc(alias = "JSStringGetMaximumUTF8CStringSize")]
|
||||
pub fn maximum_utf8_cstring_size(&self) -> usize {
|
||||
unsafe { ffi::JSStringGetMaximumUTF8CStringSize(*self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
// #[doc(alias = "JSStringGetUTF8CString")]
|
||||
// pub fn getUTF8CString(&self, buffer: glib::GString, buffer_size: usize) -> usize {
|
||||
// unsafe { ffi::JSStringGetUTF8CString(*self.to_glib_none().0, buffer.to_glib_f) }
|
||||
// }
|
||||
}
|
||||
101
src/value_ref.rs
Normal file
101
src/value_ref.rs
Normal file
@@ -0,0 +1,101 @@
|
||||
// // Copyright 2013-2017, The Gtk-rs Project Developers.
|
||||
// // See the COPYRIGHT file at the top-level directory of this distribution.
|
||||
// // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT>
|
||||
#![cfg_attr(feature = "dox", feature(doc_cfg))]
|
||||
|
||||
use ffi::*;
|
||||
use glib::translate::*;
|
||||
use std::ptr;
|
||||
|
||||
use crate::GlobalContextRef;
|
||||
|
||||
pub struct ValueRef {
|
||||
raw: JSValueRef,
|
||||
}
|
||||
|
||||
impl ValueRef {
|
||||
pub fn is_boolean(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsBoolean(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_null(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsNull(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_undefined(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsUndefined(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_number(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsNumber(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_string(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsString(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_object(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsObject(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_array(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsArray(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn is_date(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueIsDate(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn to_number(&self, context: &GlobalContextRef) -> Option<f64> {
|
||||
let mut exception = ptr::null_mut();
|
||||
let result = unsafe { JSValueToNumber(context.to_glib_none().0, self.raw, &mut exception) };
|
||||
if exception.is_null() {
|
||||
Some(result)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_boolean(&self, context: &GlobalContextRef) -> bool {
|
||||
unsafe { JSValueToBoolean(context.to_glib_none().0, self.raw) != 0 }
|
||||
}
|
||||
|
||||
pub fn to_string(&self, context: &GlobalContextRef) -> Option<String> {
|
||||
unsafe {
|
||||
let mut exception = ptr::null_mut();
|
||||
let jsstring = JSValueToStringCopy(context.to_glib_none().0, self.raw, &mut exception);
|
||||
|
||||
if exception.is_null() {
|
||||
let cap = JSStringGetMaximumUTF8CStringSize(jsstring);
|
||||
let mut buf = Vec::<u8>::with_capacity(cap);
|
||||
let len = JSStringGetUTF8CString(jsstring, buf.as_mut_ptr() as _, cap);
|
||||
JSStringRelease(jsstring);
|
||||
buf.set_len(len - 1);
|
||||
String::from_utf8(buf).ok()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FromGlibPtrNone<JSValueRef> for ValueRef {
|
||||
unsafe fn from_glib_none(ptr: JSValueRef) -> Self {
|
||||
ValueRef { raw: ptr }
|
||||
}
|
||||
}
|
||||
|
||||
impl FromGlibPtrFull<JSValueRef> for ValueRef {
|
||||
unsafe fn from_glib_full(ptr: JSValueRef) -> Self {
|
||||
ValueRef { raw: ptr }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToGlibPtr<'a, JSValueRef> for ValueRef {
|
||||
type Storage = ();
|
||||
|
||||
#[inline]
|
||||
fn to_glib_none(&self) -> Stash<'a, JSValueRef, ValueRef> {
|
||||
Stash(self.raw, ())
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "javascriptcore-rs-sys"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
authors = [ "The Gtk-rs Project Developers" ]
|
||||
description = "Sys functions for the Rust bindings of the javacriptcore library"
|
||||
repository = "https://github.com/tauri-apps/javascriptcore-rs"
|
||||
@@ -17,10 +17,10 @@ version = "2.24"
|
||||
version = "2.28"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = [ "dox" ]
|
||||
features = ["dox"]
|
||||
|
||||
[lib]
|
||||
name = "javascriptcore_sys"
|
||||
name = "javascriptcore_rs_sys"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
@@ -35,5 +35,5 @@ shell-words = "1.0.0"
|
||||
tempfile = "3"
|
||||
|
||||
[features]
|
||||
v2_28 = [ ]
|
||||
dox = [ ]
|
||||
v2_28 = []
|
||||
dox = []
|
||||
@@ -9,4 +9,4 @@ girs_directories = [ "../gir-files/" ]
|
||||
external_libraries = [
|
||||
"GLib",
|
||||
"GObject",
|
||||
]
|
||||
]
|
||||
@@ -1,5 +1,5 @@
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
// from ../gir-files (@ d11622cc2fc4)
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(not(feature = "dox"))]
|
||||
@@ -1,5 +1,5 @@
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
// from ../gir-files (@ d11622cc2fc4)
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
// DO NOT EDIT
|
||||
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
@@ -47,8 +47,8 @@ pub const JSC_OPTION_RANGE_STRING: JSCOptionType = 6;
|
||||
|
||||
// Constants
|
||||
pub const JSC_MAJOR_VERSION: c_int = 2;
|
||||
pub const JSC_MICRO_VERSION: c_int = 3;
|
||||
pub const JSC_MINOR_VERSION: c_int = 32;
|
||||
pub const JSC_MICRO_VERSION: c_int = 1;
|
||||
pub const JSC_MINOR_VERSION: c_int = 34;
|
||||
pub const JSC_OPTIONS_USE_DFG: *const c_char = b"useDFGJIT\0" as *const u8 as *const c_char;
|
||||
pub const JSC_OPTIONS_USE_FTL: *const c_char = b"useFTLJIT\0" as *const u8 as *const c_char;
|
||||
pub const JSC_OPTIONS_USE_JIT: *const c_char = b"useJIT\0" as *const u8 as *const c_char;
|
||||
@@ -79,10 +79,19 @@ pub type JSCClassSetPropertyFunction = Option<
|
||||
*mut JSCValue,
|
||||
) -> gboolean,
|
||||
>;
|
||||
pub type JSCClassVariadicFunction =
|
||||
Option<unsafe extern "C" fn(gpointer, *mut glib::GPtrArray, gpointer) -> *mut JSCValue>;
|
||||
pub type JSCConstructor = Option<unsafe extern "C" fn(*mut glib::GPtrArray, gpointer) -> gpointer>;
|
||||
pub type JSCExceptionHandler =
|
||||
Option<unsafe extern "C" fn(*mut JSCContext, *mut JSCException, gpointer)>;
|
||||
pub type JSCGetter = Option<unsafe extern "C" fn(gpointer) -> *mut JSCValue>;
|
||||
pub type JSCOptionsFunc =
|
||||
Option<unsafe extern "C" fn(*const c_char, JSCOptionType, *const c_char, gpointer) -> gboolean>;
|
||||
pub type JSCPropertyGetter = Option<unsafe extern "C" fn(gpointer, gpointer) -> *mut JSCValue>;
|
||||
pub type JSCPropertySetter = Option<unsafe extern "C" fn(gpointer, *mut JSCValue, gpointer)>;
|
||||
pub type JSCSetter = Option<unsafe extern "C" fn(*mut JSCValue, gpointer)>;
|
||||
pub type JSCVariadicFunction =
|
||||
Option<unsafe extern "C" fn(*mut glib::GPtrArray, gpointer) -> *mut JSCValue>;
|
||||
|
||||
// Records
|
||||
#[repr(C)]
|
||||
@@ -255,6 +264,21 @@ pub struct _JSCWeakValuePrivate(c_void);
|
||||
|
||||
pub type JSCWeakValuePrivate = *mut _JSCWeakValuePrivate;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct _JSGlobalContextRef(c_void);
|
||||
|
||||
pub type JSGlobalContextRef = *mut _JSGlobalContextRef;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct _JSStringRef(c_void);
|
||||
|
||||
pub type JSStringRef = *mut _JSStringRef;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct _JSValueRef(c_void);
|
||||
|
||||
pub type JSValueRef = *mut _JSValueRef;
|
||||
|
||||
// Classes
|
||||
#[repr(C)]
|
||||
pub struct JSCClass(c_void);
|
||||
@@ -343,6 +367,49 @@ impl ::std::fmt::Debug for JSCWeakValue {
|
||||
#[link(name = "javascriptcoregtk-4.0")]
|
||||
extern "C" {
|
||||
|
||||
//=========================================================================
|
||||
// JSGlobalContextRef
|
||||
//=========================================================================
|
||||
pub fn JSGlobalContextRetain(context: JSGlobalContextRef);
|
||||
pub fn JSGlobalContextRelease(context: JSGlobalContextRef);
|
||||
|
||||
//=========================================================================
|
||||
// JSStringRef
|
||||
//=========================================================================
|
||||
pub fn JSStringRetain(string: JSStringRef);
|
||||
pub fn JSStringRelease(string: JSStringRef);
|
||||
pub fn JSStringGetMaximumUTF8CStringSize(string: JSStringRef) -> size_t;
|
||||
pub fn JSStringGetUTF8CString(
|
||||
string: JSStringRef,
|
||||
buffer: *mut *mut c_char,
|
||||
buffer_size: size_t,
|
||||
) -> size_t;
|
||||
|
||||
//=========================================================================
|
||||
// JSValueRef
|
||||
//=========================================================================
|
||||
pub fn JSValueIsArray(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueProtect(context: JSGlobalContextRef, value: JSValueRef);
|
||||
pub fn JSValueUnprotect(context: JSGlobalContextRef, value: JSValueRef);
|
||||
pub fn JSValueIsBoolean(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsDate(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsObject(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsNull(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsNumber(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsString(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueIsUndefined(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueToBoolean(ctx: JSGlobalContextRef, value: JSValueRef) -> gboolean;
|
||||
pub fn JSValueToNumber(
|
||||
ctx: JSGlobalContextRef,
|
||||
value: JSValueRef,
|
||||
exception: *mut *mut JSCException,
|
||||
) -> c_double;
|
||||
pub fn JSValueToStringCopy(
|
||||
ctx: JSGlobalContextRef,
|
||||
value: JSValueRef,
|
||||
exception: *mut JSValueRef,
|
||||
) -> JSStringRef;
|
||||
|
||||
//=========================================================================
|
||||
// JSCClass
|
||||
//=========================================================================
|
||||
@@ -360,7 +427,7 @@ extern "C" {
|
||||
pub fn jsc_class_add_constructor_variadic(
|
||||
jsc_class: *mut JSCClass,
|
||||
name: *const c_char,
|
||||
callback: gobject::GCallback,
|
||||
callback: JSCConstructor,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
return_type: GType,
|
||||
@@ -388,7 +455,7 @@ extern "C" {
|
||||
pub fn jsc_class_add_method_variadic(
|
||||
jsc_class: *mut JSCClass,
|
||||
name: *const c_char,
|
||||
callback: gobject::GCallback,
|
||||
callback: JSCClassVariadicFunction,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
return_type: GType,
|
||||
@@ -407,8 +474,8 @@ extern "C" {
|
||||
jsc_class: *mut JSCClass,
|
||||
name: *const c_char,
|
||||
property_type: GType,
|
||||
getter: gobject::GCallback,
|
||||
setter: gobject::GCallback,
|
||||
getter: JSCPropertyGetter,
|
||||
setter: JSCPropertySetter,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
);
|
||||
@@ -554,7 +621,7 @@ extern "C" {
|
||||
pub fn jsc_value_new_function_variadic(
|
||||
context: *mut JSCContext,
|
||||
name: *const c_char,
|
||||
callback: gobject::GCallback,
|
||||
callback: JSCVariadicFunction,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
return_type: GType,
|
||||
@@ -617,8 +684,8 @@ extern "C" {
|
||||
property_name: *const c_char,
|
||||
flags: JSCValuePropertyFlags,
|
||||
property_type: GType,
|
||||
getter: gobject::GCallback,
|
||||
setter: gobject::GCallback,
|
||||
getter: JSCGetter,
|
||||
setter: JSCSetter,
|
||||
user_data: gpointer,
|
||||
destroy_notify: glib::GDestroyNotify,
|
||||
);
|
||||
@@ -1,5 +1,5 @@
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
// from ../gir-files (@ d11622cc2fc4)
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
// DO NOT EDIT
|
||||
|
||||
use javascriptcore_sys::*;
|
||||
@@ -330,8 +330,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
"3",
|
||||
),
|
||||
("JSC_MAJOR_VERSION", "2"),
|
||||
("JSC_MICRO_VERSION", "3"),
|
||||
("JSC_MINOR_VERSION", "32"),
|
||||
("JSC_MICRO_VERSION", "1"),
|
||||
("JSC_MINOR_VERSION", "34"),
|
||||
("JSC_OPTIONS_USE_DFG", "useDFGJIT"),
|
||||
("JSC_OPTIONS_USE_FTL", "useFTLJIT"),
|
||||
("JSC_OPTIONS_USE_JIT", "useJIT"),
|
||||
@@ -1,5 +1,5 @@
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
// from ../gir-files (@ d11622cc2fc4)
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
// DO NOT EDIT
|
||||
|
||||
#include "manual.h"
|
||||
@@ -1,5 +1,5 @@
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ 05fe12c0b7e7)
|
||||
// from ../gir-files (@ d11622cc2fc4)
|
||||
// Generated by gir (https://github.com/gtk-rs/gir @ a97e6087cf6b)
|
||||
// from gir-files (https://github.com/vhdirk/gir-files @ 5c5c482b7f4a)
|
||||
// DO NOT EDIT
|
||||
|
||||
#include "manual.h"
|
||||
Reference in New Issue
Block a user