[vala/staging] webkit2gtk-4.0: Add JSC namespace to javascriptcoregtk-4.0 and fix depends
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] webkit2gtk-4.0: Add JSC namespace to javascriptcoregtk-4.0 and fix depends
- Date: Tue, 24 Apr 2018 13:37:09 +0000 (UTC)
commit 2d8150d943b44219486c3f184230400a507c056e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Apr 24 08:49:39 2018 +0200
webkit2gtk-4.0: Add JSC namespace to javascriptcoregtk-4.0 and fix depends
Make JS namespace deprecated since 2.22 accordingly
https://bugzilla.gnome.org/show_bug.cgi?id=795497
vapi/javascriptcoregtk-4.0.vapi | 148 +++++++++++++++++++++++-
vapi/metadata/JavaScriptCore-4.0-custom.vala | 12 ++-
vapi/metadata/JavaScriptCore-4.0.metadata | 8 +-
vapi/metadata/WebKit2-4.0.metadata | 1 +
vapi/metadata/WebKit2WebExtension-4.0.metadata | 7 +
vapi/webkit2gtk-4.0.vapi | 2 +-
vapi/webkit2gtk-web-extension-4.0.vapi | 10 +-
7 files changed, 176 insertions(+), 12 deletions(-)
---
diff --git a/vapi/javascriptcoregtk-4.0.vapi b/vapi/javascriptcoregtk-4.0.vapi
index c937cae..aceba5c 100644
--- a/vapi/javascriptcoregtk-4.0.vapi
+++ b/vapi/javascriptcoregtk-4.0.vapi
@@ -1,6 +1,7 @@
/* javascriptcoregtk-4.0.vapi generated by vapigen, do not modify. */
-[CCode (cprefix = "JS", gir_namespace = "JavaScriptCore", gir_version = "4.0", lower_case_cprefix = "JS_")]
+[CCode (cprefix = "JS", gir_namespace = "JavaScript", gir_version = "4.0", lower_case_cprefix = "JS_")]
+[Version (deprecated = true, deprecated_since = "2.22")]
namespace JS {
[CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "void", free_function =
"JSClassRelease", has_type_id = false)]
[Compact]
@@ -148,3 +149,148 @@ namespace JS {
NONE
}
}
+[CCode (cprefix = "JSC", gir_namespace = "JavaScriptCore", gir_version = "4.0", lower_case_cprefix = "jsc_")]
+namespace JSC {
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_class_get_type ()")]
+ public class Class : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Class ();
+ public void add_property (string name, GLib.Type property_type, [CCode (scope = "async")]
GLib.Callback? getter, [CCode (scope = "async")] GLib.Callback? setter, void* user_data, GLib.DestroyNotify?
destroy_notify);
+ public unowned string get_name ();
+ public unowned JSC.Class get_parent ();
+ [NoAccessorMethod]
+ public JSC.Context context { owned get; construct; }
+ public string name { get; construct; }
+ public JSC.Class parent { get; construct; }
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_context_get_type ()")]
+ public class Context : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Context ();
+ public void clear_exception ();
+ public JSC.Value evaluate (string code, ssize_t length);
+ public JSC.Value evaluate_with_source_uri (string code, ssize_t length, string uri);
+ public static unowned JSC.Context? get_current ();
+ public unowned JSC.Exception? get_exception ();
+ public JSC.Value get_value (string name);
+ public unowned JSC.VirtualMachine get_virtual_machine ();
+ public void pop_exception_handler ();
+ public void push_exception_handler (owned JSC.ExceptionHandler handler);
+ public unowned JSC.Class register_class (string name, JSC.Class? parent_class,
JSC.ClassVTable? vtable, GLib.DestroyNotify? destroy_notify);
+ public void set_value (string name, JSC.Value value);
+ public void @throw (string error_message);
+ public void throw_exception (JSC.Exception exception);
+ [CCode (has_construct_function = false)]
+ public Context.with_virtual_machine (JSC.VirtualMachine vm);
+ public JSC.VirtualMachine virtual_machine { get; construct; }
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_exception_get_type ()")]
+ public class Exception : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public Exception (JSC.Context context, string message);
+ public uint get_line_number ();
+ public unowned string get_message ();
+ public unowned string? get_source_uri ();
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_value_get_type ()")]
+ public class Value : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Value ();
+ [CCode (has_construct_function = false)]
+ public Value.array_from_garray (JSC.Context context, GLib.GenericArray<JSC.Value>? array);
+ [CCode (has_construct_function = false)]
+ public Value.boolean (JSC.Context context, bool value);
+ public unowned JSC.Context get_context ();
+ public bool is_array ();
+ public bool is_boolean ();
+ public bool is_constructor ();
+ public bool is_function ();
+ public bool is_null ();
+ public bool is_number ();
+ public bool is_object ();
+ public bool is_string ();
+ public bool is_undefined ();
+ [CCode (has_construct_function = false)]
+ public Value.@null (JSC.Context context);
+ [CCode (has_construct_function = false)]
+ public Value.number (JSC.Context context, double number);
+ [CCode (has_construct_function = false)]
+ public Value.object (JSC.Context context, void* instance, JSC.Class? jsc_class);
+ public void object_define_property_accessor (global::string property_name,
JSC.ValuePropertyFlags flags, GLib.Type property_type, [CCode (scope = "async")] GLib.Callback? getter,
[CCode (scope = "async")] GLib.Callback? setter, void* user_data, GLib.DestroyNotify? destroy_notify);
+ public void object_define_property_data (global::string property_name, JSC.ValuePropertyFlags
flags, JSC.Value? property_value);
+ public bool object_delete_property (global::string name);
+ [CCode (array_length = false, array_null_terminated = true)]
+ public global::string[]? object_enumerate_properties ();
+ public JSC.Value object_get_property (global::string name);
+ public JSC.Value object_get_property_at_index (uint index);
+ public bool object_has_property (global::string name);
+ public bool object_is_instance_of (global::string name);
+ public void object_set_property (global::string name, JSC.Value property);
+ public void object_set_property_at_index (uint index, JSC.Value property);
+ [CCode (has_construct_function = false)]
+ public Value.string (JSC.Context context, global::string? string);
+ [CCode (has_construct_function = false)]
+ public Value.string_from_bytes (JSC.Context context, GLib.Bytes? bytes);
+ public bool to_boolean ();
+ public double to_double ();
+ public int32 to_int32 ();
+ public global::string to_string ();
+ public GLib.Bytes to_string_as_bytes ();
+ [CCode (has_construct_function = false)]
+ public Value.undefined (JSC.Context context);
+ public JSC.Context context { get; construct; }
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_virtual_machine_get_type ()")]
+ public class VirtualMachine : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public VirtualMachine ();
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", type_id = "jsc_weak_value_get_type ()")]
+ public class WeakValue : GLib.Object {
+ [CCode (has_construct_function = false)]
+ public WeakValue (JSC.Value value);
+ public JSC.Value get_value ();
+ [NoAccessorMethod]
+ public JSC.Value value { construct; }
+ public signal void cleared ();
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", has_type_id = false)]
+ public struct ClassVTable {
+ public weak JSC.ClassGetPropertyFunction get_property;
+ public weak JSC.ClassSetPropertyFunction set_property;
+ public weak JSC.ClassHasPropertyFunction has_property;
+ public weak JSC.ClassDeletePropertyFunction delete_property;
+ public weak JSC.ClassEnumeratePropertiesFunction enumerate_properties;
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", cprefix = "JSC_VALUE_PROPERTY_", has_type_id = false)]
+ [Flags]
+ public enum ValuePropertyFlags {
+ CONFIGURABLE,
+ ENUMERABLE,
+ WRITABLE
+ }
+ [CCode (cheader_filename = "jsc/jsc.h", has_target = false)]
+ public delegate bool ClassDeletePropertyFunction (JSC.Class jsc_class, JSC.Context context, void*
instance, string name);
+ [CCode (array_length = false, array_null_terminated = true, cheader_filename = "jsc/jsc.h",
has_target = false)]
+ public delegate string[]? ClassEnumeratePropertiesFunction (JSC.Class jsc_class, JSC.Context context,
void* instance);
+ [CCode (cheader_filename = "jsc/jsc.h", has_target = false)]
+ public delegate JSC.Value? ClassGetPropertyFunction (JSC.Class jsc_class, JSC.Context context, void*
instance, string name);
+ [CCode (cheader_filename = "jsc/jsc.h", has_target = false)]
+ public delegate bool ClassHasPropertyFunction (JSC.Class jsc_class, JSC.Context context, void*
instance, string name);
+ [CCode (cheader_filename = "jsc/jsc.h", has_target = false)]
+ public delegate bool ClassSetPropertyFunction (JSC.Class jsc_class, JSC.Context context, void*
instance, string name, JSC.Value value);
+ [CCode (cheader_filename = "jsc/jsc.h", instance_pos = 2.9)]
+ public delegate void ExceptionHandler (JSC.Context context, JSC.Exception exception);
+ [CCode (cheader_filename = "jsc/jsc.h", cname = "JSC_MAJOR_VERSION")]
+ public const int MAJOR_VERSION;
+ [CCode (cheader_filename = "jsc/jsc.h", cname = "JSC_MICRO_VERSION")]
+ public const int MICRO_VERSION;
+ [CCode (cheader_filename = "jsc/jsc.h", cname = "JSC_MINOR_VERSION")]
+ public const int MINOR_VERSION;
+ [CCode (cheader_filename = "jsc/jsc.h")]
+ public static uint get_major_version ();
+ [CCode (cheader_filename = "jsc/jsc.h")]
+ public static uint get_micro_version ();
+ [CCode (cheader_filename = "jsc/jsc.h")]
+ public static uint get_minor_version ();
+}
diff --git a/vapi/metadata/JavaScriptCore-4.0-custom.vala b/vapi/metadata/JavaScriptCore-4.0-custom.vala
index 2a1125f..b0e0e27 100644
--- a/vapi/metadata/JavaScriptCore-4.0-custom.vala
+++ b/vapi/metadata/JavaScriptCore-4.0-custom.vala
@@ -3,7 +3,8 @@
* Copyright 2011 Jiří Janoušek <janousek jiri gmail com>
* Copyright 2017 Michael Gratton <mike vee net>
*/
-[CCode (cprefix = "JS", gir_namespace = "JavaScriptCore", gir_version = "4.0", lower_case_cprefix = "JS_")]
+[CCode (cprefix = "JS", gir_namespace = "JavaScript", gir_version = "4.0", lower_case_cprefix = "JS_")]
+[Version (deprecated = true, deprecated_since = "2.22")]
namespace JS {
[CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "void", free_function =
"JSClassRelease", has_type_id = false)]
[Compact]
@@ -156,3 +157,12 @@ namespace JS {
NONE
}
}
+
+namespace JSC {
+ public class Class : GLib.Object {
+ public void add_property (string name, GLib.Type property_type, [CCode (scope = "async")]
GLib.Callback? getter, [CCode (scope = "async")] GLib.Callback? setter, void* user_data, GLib.DestroyNotify?
destroy_notify);
+ }
+ public class Value : GLib.Object {
+ public void object_define_property_accessor (global::string property_name,
JSC.ValuePropertyFlags flags, GLib.Type property_type, [CCode (scope = "async")] GLib.Callback? getter,
[CCode (scope = "async")] GLib.Callback? setter, void* user_data, GLib.DestroyNotify? destroy_notify);
+ }
+}
diff --git a/vapi/metadata/JavaScriptCore-4.0.metadata b/vapi/metadata/JavaScriptCore-4.0.metadata
index a153955..e46c40e 100644
--- a/vapi/metadata/JavaScriptCore-4.0.metadata
+++ b/vapi/metadata/JavaScriptCore-4.0.metadata
@@ -1,4 +1,4 @@
-* cheader_filename="JavaScriptCore/JavaScript.h"
-
-GlobalContext struct=false
-Value struct=false
+Class
+ .add_property skip
+Value
+ .object_define_property_accessor skip
diff --git a/vapi/metadata/WebKit2-4.0.metadata b/vapi/metadata/WebKit2-4.0.metadata
index d650ba9..e03d406 100644
--- a/vapi/metadata/WebKit2-4.0.metadata
+++ b/vapi/metadata/WebKit2-4.0.metadata
@@ -4,6 +4,7 @@ Download
JavascriptResult
.get_global_context type="unowned JS.GlobalContext" skip=false
.get_value type="unowned JS.Value" skip=false
+ .get_js_value type="unowned JSC.Value"
PrintOperation
.failed#signal.error type="WebKit.PrintError"
WebResource
diff --git a/vapi/metadata/WebKit2WebExtension-4.0.metadata b/vapi/metadata/WebKit2WebExtension-4.0.metadata
index a727bfa..015be62 100644
--- a/vapi/metadata/WebKit2WebExtension-4.0.metadata
+++ b/vapi/metadata/WebKit2WebExtension-4.0.metadata
@@ -12,6 +12,13 @@ DOMEventTarget.remove_event_listener_with_closure.handler type="owned WebKit.DOM
Frame
.get_javascript_context_for_script_world type="unowned JS.GlobalContext" skip=false
.get_javascript_global_context type="unowned JS.GlobalContext" skip=false
+ .get_js_context type="JSC.Context"
+ .get_js_context_for_script_world type="JSC.Context"
+ .get_js_value_for_dom_object type="JSC.Value"
+ .get_js_value_for_dom_object_in_script_world type="JSC.Value"
+
+DOMNode
+ .for_js_value.value type="JSC.Value"
URIRequest.get_http_headers unowned
URIResponse.get_http_headers unowned
diff --git a/vapi/webkit2gtk-4.0.vapi b/vapi/webkit2gtk-4.0.vapi
index 9b35637..8a04595 100644
--- a/vapi/webkit2gtk-4.0.vapi
+++ b/vapi/webkit2gtk-4.0.vapi
@@ -342,7 +342,7 @@ namespace WebKit {
[Version (deprecated = true, deprecated_since = "2.22")]
public unowned JS.GlobalContext get_global_context ();
[Version (since = "2.22")]
- public unowned JS.Value get_js_value ();
+ public unowned JSC.Value get_js_value ();
[Version (deprecated = true, deprecated_since = "2.22")]
public unowned JS.Value get_value ();
public unowned WebKit.JavascriptResult @ref ();
diff --git a/vapi/webkit2gtk-web-extension-4.0.vapi b/vapi/webkit2gtk-web-extension-4.0.vapi
index b315aa1..226a37e 100644
--- a/vapi/webkit2gtk-web-extension-4.0.vapi
+++ b/vapi/webkit2gtk-web-extension-4.0.vapi
@@ -3250,7 +3250,7 @@ namespace WebKit {
[Version (deprecated = true, deprecated_since = "2.22")]
public bool contains (WebKit.DOM.Node other);
[Version (since = "2.22")]
- public static unowned WebKit.DOM.Node for_js_value (JS.Value value);
+ public static unowned WebKit.DOM.Node for_js_value ([CCode (type = "JSCValue*")]
JSC.Value value);
[Version (deprecated = true, deprecated_since = "2.22")]
public string get_base_uri ();
[Version (deprecated = true, deprecated_since = "2.22")]
@@ -4014,13 +4014,13 @@ namespace WebKit {
[Version (deprecated = true, deprecated_since = "2.22", since = "2.2")]
public unowned JS.GlobalContext get_javascript_global_context ();
[Version (since = "2.22")]
- public JS.Context get_js_context ();
+ public JSC.Context get_js_context ();
[Version (since = "2.22")]
- public JS.Context get_js_context_for_script_world (WebKit.ScriptWorld world);
+ public JSC.Context get_js_context_for_script_world (WebKit.ScriptWorld world);
[Version (since = "2.22")]
- public JS.Value get_js_value_for_dom_object (WebKit.DOM.Object dom_object);
+ public JSC.Value get_js_value_for_dom_object (WebKit.DOM.Object dom_object);
[Version (since = "2.22")]
- public JS.Value get_js_value_for_dom_object_in_script_world (WebKit.DOM.Object dom_object,
WebKit.ScriptWorld world);
+ public JSC.Value get_js_value_for_dom_object_in_script_world (WebKit.DOM.Object dom_object,
WebKit.ScriptWorld world);
[Version (since = "2.2")]
public unowned string get_uri ();
[Version (since = "2.2")]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]