Skip to content

Commit

Permalink
Merge pull request #61 from vhdirk/regenerate
Browse files Browse the repository at this point in the history
regenerate from latest gir files
  • Loading branch information
Ngo Iok Ui (Wu Yu Wei) authored Nov 3, 2021
2 parents 4494852 + 68fa7e5 commit c216072
Show file tree
Hide file tree
Showing 32 changed files with 302 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"packages": {
"javascriptcore-rs-sys": {
"path": "./javascriptcore-sys",
"path": "./sys",
"manager": "rust"
},
"javascriptcore-rs": {
Expand Down
7 changes: 7 additions & 0 deletions .changes/regen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"javascriptcore-rs-sys": patch
"javascriptcore-rs": patch
---

Regenerate with latest gir-files

2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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" ]
Expand Down
15 changes: 8 additions & 7 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -32,7 +29,6 @@ generate = [
"JavaScriptCore.PropertyGetter",
"JavaScriptCore.PropertySetter",
"JavaScriptCore.Setter",
"JavaScriptCore.StringRef",
"JavaScriptCore.ValuePropertyFlags",
"JavaScriptCore.VariadicFunction",
"JavaScriptCore.VirtualMachine",
Expand All @@ -43,6 +39,8 @@ manual = [
"GLib.DestroyNotify",
"GLib.OptionGroup",
"GObject.Callback",
"JavaScriptCore.StringRef",
"JavaScriptCore.GlobalContextRef",
]

[[object]]
Expand All @@ -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 change: 1 addition & 0 deletions generator.py
2 changes: 1 addition & 1 deletion gir-files
Submodule gir-files updated 34 files
+1 −0 .gitignore
+3,550 −10,890 Atk-1.0.gir
+224 −152 GIRepository-2.0.gir
+14,057 −35,443 GLib-2.0.gir
+115 −47 GModule-2.0.gir
+4,816 −12,215 GObject-2.0.gir
+5,826 −17,513 Gdk-3.0.gir
+15,140 −4,039 Gdk-4.0.gir
+2,534 −3,489 GdkPixbuf-2.0.gir
+115 −100 GdkPixdata-2.0.gir
+136 −79 GdkWayland-4.0.gir
+1,208 −348 GdkX11-4.0.gir
+15,701 −12,909 Gio-2.0.gir
+20 −36 Graphene-1.0.gir
+3,721 −1,127 Gsk-4.0.gir
+30,016 −90,790 Gtk-3.0.gir
+21,139 −15,828 Gtk-4.0.gir
+2,623 −2,144 HarfBuzz-0.0.gir
+355 −0 JavaScriptCore-4.0-patch.gir
+1,152 −603 JavaScriptCore-4.0.gir
+84 −0 JavaScriptCore-4.0.xsl
+2,798 −2,169 Pango-1.0.gir
+527 −154 PangoCairo-1.0.gir
+336 −100 PangoFT2-1.0.gir
+593 −162 PangoFc-1.0.gir
+760 −226 PangoOT-1.0.gir
+478 −136 PangoXft-1.0.gir
+15,958 −4,767 Soup-2.4.gir
+5,353 −3,358 WebKit2-4.0.gir
+6,927 −4,653 WebKit2WebExtension-4.0.gir
+12 −11 dl.sh
+20 −0 fix.sh
+2 −9 freetype2-2.0.gir
+2 −7 win32-1.0.gir
8 changes: 4 additions & 4 deletions src/auto/class.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand All @@ -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() }
//}

Expand All @@ -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() }
//}

Expand All @@ -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() }
//}

Expand Down
2 changes: 1 addition & 1 deletion src/auto/context.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/exception.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/flags.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
11 changes: 2 additions & 9 deletions src/auto/value.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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() }
//}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/auto/versions.txt
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion src/auto/virtual_machine.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion src/auto/weak_value.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
28 changes: 28 additions & 0 deletions src/global_context_ref.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions src/string_ref.rs
Original file line number Diff line number Diff line change
@@ -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) }
// }
}
Loading

0 comments on commit c216072

Please sign in to comment.