]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
javascriptcoregtk-4.0: Make JSC.Class usable by defining the right callback 811787bc3f06b577de428050942f7476a70d187d 92/head
authorCorentin Noël <corentin@elementary.io>
Mon, 23 Dec 2019 11:47:40 +0000 (12:47 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 28 Jan 2020 16:36:00 +0000 (17:36 +0100)
vapi/javascriptcoregtk-4.0.vapi
vapi/metadata/JavaScriptCore-4.0-custom.vala
vapi/metadata/JavaScriptCore-4.0.metadata

index 0e2cbbcc4dd7fe986812c39620d82f5bb9d2c64e..423024869dec2c3c79ab4aea052abddc41802087 100644 (file)
@@ -217,10 +217,10 @@ namespace JSC {
        public class Class : GLib.Object {
                [CCode (has_construct_function = false)]
                protected Class ();
-               public JSC.Value add_constructor_variadic (string? name, GLib.Callback callback, void* user_data, GLib.DestroyNotify? destroy_notify, GLib.Type return_type);
-               public JSC.Value add_constructorv (string? name, GLib.Callback callback, void* user_data, GLib.DestroyNotify? destroy_notify, GLib.Type return_type, [CCode (array_length_cname = "n_parameters", array_length_pos = 5.5, array_length_type = "guint")] GLib.Type[]? parameter_types);
-               public void add_method_variadic (string name, GLib.Callback callback, void* user_data, GLib.DestroyNotify? destroy_notify, GLib.Type return_type);
-               public void add_methodv (string name, GLib.Callback callback, void* user_data, GLib.DestroyNotify? destroy_notify, GLib.Type return_type, [CCode (array_length_cname = "n_parameters", array_length_pos = 5.5, array_length_type = "guint")] GLib.Type[]? parameter_types);
+               [CCode (cname = "jsc_class_add_constructor_variadic")]
+               public JSC.Value add_constructor (string? name, [CCode (delegate_target_pos = 2.33333, destroy_notify_pos = 2.66667, type = "GCallback")] owned JSC.ClassConstructorCb callback, GLib.Type return_type);
+               [CCode (cname = "jsc_class_add_method_variadic")]
+               public void add_method (string name, [CCode (delegate_target_pos = 2.33333, destroy_notify_pos = 2.66667, type = "GCallback")] owned JSC.ClassMethodCb callback, GLib.Type return_type);
                public void add_property (string name, GLib.Type property_type, [CCode (scope = "async")] GLib.Callback? getter, GLib.Callback? setter, void* user_data, GLib.DestroyNotify? destroy_notify);
                public unowned string get_name ();
                public unowned JSC.Class get_parent ();
@@ -385,6 +385,8 @@ namespace JSC {
                ENUMERABLE,
                WRITABLE
        }
+       [CCode (cheader_filename = "jsc/jsc.h", instance_pos = 1.9, type_cname = "GCallback")]
+       public delegate T ClassConstructorCb<T> (GLib.GenericArray<JSC.Value> values);
        [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)]
@@ -393,6 +395,8 @@ namespace JSC {
        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", instance_pos = 2.9, type_cname = "GCallback")]
+       public delegate T ClassMethodCb<T> (JSC.Class instance, GLib.GenericArray<JSC.Value> values);
        [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)]
index 5e53d20b0fff18caf624e84d927c5bb31e15ccf1..164c7e0596bbfc09d66f1316b2ef95f06970701d 100644 (file)
@@ -159,4 +159,8 @@ namespace JS {
 }
 
 namespace JSC {
+       [CCode (type_cname = "GCallback", instance_pos = 1.9)]
+       public delegate T ClassConstructorCb<T> (GLib.GenericArray<JSC.Value> values);
+       [CCode (type_cname = "GCallback", instance_pos = 2.9)]
+       public delegate T ClassMethodCb<T> (JSC.Class instance, GLib.GenericArray<JSC.Value> values);
 }
index c0b9e071bc05ba62e555ca0580ba81818274370d..5e5b14f90038aa7e869110757dbaf4279f101533 100644 (file)
@@ -4,10 +4,14 @@ OPTIONS_* parent="JSC.Options" name="OPTIONS_(.+)"
 Class
   .add_property.getter closure=-1 destroy=-1 owned=false
   .add_property.setter closure=-1 destroy=-1 owned=false
-  .add_constructor_variadic.callback closure=-1 destroy=-1 owned=false
-  .add_constructorv.callback closure=-1 destroy=-1 owned=false
-  .add_method_variadic.callback closure=-1 destroy=-1 owned=false
-  .add_methodv.callback closure=-1 destroy=-1 owned=false
+  .add_constructor skip
+  .add_constructorv skip
+  .add_constructor_variadic name="add_constructor"
+  .add_constructor_variadic.callback type="owned JSC.ClassConstructorCb"
+  .add_method skip
+  .add_methodv skip
+  .add_method_variadic name="add_method"
+  .add_method_variadic.callback type="owned JSC.ClassMethodCb"
 Value
   .new_function_variadic.callback closure=-1 destroy=-1 owned=false
   .new_functionv.callback closure=-1 destroy=-1 owned=false