]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
javascriptcoregtk-4.0: Fix JSC.Class.add_property() binding
authorMichael James Gratton <mike@vee.net>
Mon, 5 Apr 2021 01:51:50 +0000 (11:51 +1000)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 24 Jun 2021 13:25:08 +0000 (13:25 +0000)
vapi/javascriptcoregtk-4.0.vapi
vapi/metadata/JavaScriptCore-4.0-custom.vala
vapi/metadata/JavaScriptCore-4.0.metadata

index 0e79debcbbfb44e47bb9cd0407a1066bdb3db6b5..2ae2a78dc4433ffea2e1f793af7782f4419214e2 100644 (file)
@@ -221,7 +221,7 @@ namespace JSC {
                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 void add_property (string name, GLib.Type property_type, [CCode (delegate_target_pos = 4.33333, destroy_notify_pos = 4.66667, type = "GCallback")] owned JSC.ClassGetPropertyCb? getter, [CCode (delegate_target_pos = 4.33333, destroy_notify_pos = 4.66667, type = "GCallback")] owned JSC.ClassSetPropertyCb? setter);
                public unowned string get_name ();
                public unowned JSC.Class get_parent ();
                [NoAccessorMethod]
@@ -391,12 +391,16 @@ namespace JSC {
        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", cname = "GCallback", instance_pos = 1.9)]
+       public delegate T ClassGetPropertyCb<T> (JSC.Class 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", cname = "GCallback", instance_pos = 2.9)]
        public delegate T ClassMethodCb<T> (JSC.Class instance, GLib.GenericArray<JSC.Value> values);
+       [CCode (cheader_filename = "jsc/jsc.h", cname = "GCallback", instance_pos = 2.9)]
+       public delegate void ClassSetPropertyCb<T> (JSC.Class instance, T value);
        [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 be2114816bee167e22a03c732a103f41f833129b..34abdca9c0f9dc3b33305cd0c7f7069f4d83e0f6 100644 (file)
@@ -159,6 +159,14 @@ namespace JS {
 }
 
 namespace JSC {
+       public class Class : GLib.Object {
+               public void add_property (string name, GLib.Type property_type, [CCode (delegate_target_pos = 4.33333, destroy_notify_pos = 4.66667, type = "GCallback")] owned JSC.ClassGetPropertyCb? getter, [CCode (delegate_target_pos = 4.33333, destroy_notify_pos = 4.66667, type = "GCallback")] owned JSC.ClassSetPropertyCb? setter);
+       }
+       [CCode (cname = "GCallback", instance_pos = 1.9)]
+       public delegate T ClassGetPropertyCb<T> (JSC.Class instance);
+       [CCode (cname = "GCallback", instance_pos = 2.9)]
+       public delegate void ClassSetPropertyCb<T> (JSC.Class instance, T value);
+
        [CCode (cname = "GCallback", instance_pos = 1.9)]
        public delegate T ClassConstructorCb<T> (GLib.GenericArray<JSC.Value> values);
        [CCode (cname = "GCallback", instance_pos = 2.9)]
index 5e5b14f90038aa7e869110757dbaf4279f101533..26907c779a190d98c38745ead2aab9da7ee41b1f 100644 (file)
@@ -2,8 +2,6 @@ options_* parent="JSC.Options" name="options_(.+)"
 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 skip
   .add_constructorv skip
   .add_constructor_variadic name="add_constructor"
@@ -12,6 +10,7 @@ Class
   .add_methodv skip
   .add_method_variadic name="add_method"
   .add_method_variadic.callback type="owned JSC.ClassMethodCb"
+  .add_property skip
 Value
   .new_function_variadic.callback closure=-1 destroy=-1 owned=false
   .new_functionv.callback closure=-1 destroy=-1 owned=false