diff --git a/AUTHORS b/AUTHORS index 5948c9fe0..58d9c5e01 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Jürg Billeter Raffaele Sandrini +Rico Tzschichholz diff --git a/NEWS b/NEWS index 4e37dba4d..403c17543 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,24 @@ +Vala 0.52.6 +=========== + * Various improvements and bug fixes: + - codegen: + + Fix property access inside opaque compact class + + Add type declaration for implicit temporary local variable + - vala: + + Warn about unsupported cast to void and drop it [#1070] + + Don't restrict element type of GLib.Array [#1227] + + Multi-dimensional params-array not allowed [#1230] + + Accept NullType as generic type argument + + Set source references of created DataType instances in OCE + - valadoc: Correctly format background of inline @link's [#1226] + + * Bindings: + - gio-2.0: Unhide a few usable symbols which are marked not introspectable [#1222] + - gio-2.0: Backport fixes from 0.54.2 + - glib-2.0: Current constants in GLib.Math are part of glib.h [#1220] + - glib-2.0: Add RefString since 2.58 [#723] + - gtk4: Backport fixes from 0.54.2 + Vala 0.52.5 =========== * Various improvements and bug fixes: diff --git a/README.md b/README.md index d88993410..535f8899d 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,10 @@ https://gitlab.gnome.org/Archive/vala-bootstrap Here is an example on how to download and compile from a Vala release tarball. -In this example it is release version 0.42.3: +In this example it is release version 0.48.19: ```sh -curl --silent --show-error --location https://download.gnome.org/sources/vala/0.42/vala-0.42.3.tar.xz --output vala-bootstrap.tar.xz +curl --silent --show-error --location https://download.gnome.org/sources/vala/0.48/vala-0.48.19.tar.xz --output vala-bootstrap.tar.xz tar --extract --file vala-bootstrap.tar.xz cd vala-bootstrap ./configure --prefix=/opt/vala-bootstrap @@ -149,10 +149,10 @@ git clean -dfx make && sudo make install ``` -If you wish to build a specific release, for example 0.40.11: +If you wish to build a specific release, for example 0.54.1: ```sh -git checkout 0.40.11 +git checkout 0.54.1 git clean -dfx ./autogen.sh make && sudo make install diff --git a/autogen.sh b/autogen.sh index d73d92d3d..69204b247 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,12 +7,12 @@ ORIGDIR=`pwd` cd $srcdir test -z "$VALAC" && VALAC=valac -if ! $VALAC --version | sed -e 's/^Vala \([0-9]\+\.[0-9]\+\).*$/\1/' | grep -vq '^0\.\([0-9]\|1[0-1]\)$' +if ! $VALAC --version | sed -e 's/^Vala \([0-9]\+\.[0-9]\+\).*$/\1/' | grep -vq '^0\.\([0-9]\|1[0-5]\)$' then - echo "**Error**: You must have valac >= 0.12.0 installed" + echo "**Error**: You must have valac >= 0.16.1 installed" echo " to build vala. Download the appropriate package" echo " from your distribution or get the source tarball at" - echo " http://download.gnome.org/sources/vala/" + echo " https://download.gnome.org/sources/vala/" exit 1 fi diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 14aa846f9..c65fda753 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -3912,6 +3912,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator { } public void emit_temp_var (LocalVariable local, bool on_error = false) { + generate_type_declaration (local.variable_type, cfile); + var init = (!local.name.has_prefix ("*") && local.init); if (is_in_coroutine ()) { closure_struct.add_field (get_ccode_name (local.variable_type), local.name, 0, get_ccode_declarator_suffix (local.variable_type)); diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala index d5d089010..ae9fca482 100644 --- a/codegen/valaccodememberaccessmodule.vala +++ b/codegen/valaccodememberaccessmodule.vala @@ -266,8 +266,10 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule { prop.base_property == null && prop.base_interface_property == null && !(prop.property_type is ArrayType || prop.property_type is DelegateType)) { - CCodeExpression inst; - inst = new CCodeMemberAccess.pointer (pub_inst, "priv"); + CCodeExpression inst = pub_inst; + if (!((Class) current_type_symbol).is_compact) { + inst = new CCodeMemberAccess.pointer (inst, "priv"); + } set_cvalue (expr, new CCodeMemberAccess.pointer (inst, get_ccode_name (prop.field))); } else if (!get_ccode_no_accessor_method (prop)) { string getter_cname; diff --git a/doc/vala-gen-introspect.1 b/doc/vala-gen-introspect.1 index 136c7f989..fce03488d 100644 --- a/doc/vala-gen-introspect.1 +++ b/doc/vala-gen-introspect.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.4. -.TH VALA-GEN-INTROSPECT "1" "August 2021" "gen-introspect 0.52.5" "User Commands" +.TH VALA-GEN-INTROSPECT "1" "October 2021" "gen-introspect 0.52.6" "User Commands" .SH NAME vala-gen-introspect \- generate a GI file for GObject and glib based packages .SH SYNOPSIS diff --git a/doc/valac.1 b/doc/valac.1 index 5666df7a9..2b123f620 100644 --- a/doc/valac.1 +++ b/doc/valac.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.4. -.TH VALAC "1" "August 2021" "Vala 0.52.5" "User Commands" +.TH VALAC "1" "October 2021" "Vala 0.52.6" "User Commands" .SH NAME valac \- compiler that translates Vala source code into C source and header files .SH SYNOPSIS diff --git a/doc/valadoc.1 b/doc/valadoc.1 index 61f05e553..617329b55 100644 --- a/doc/valadoc.1 +++ b/doc/valadoc.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.4. -.TH VALADOC "1" "August 2021" "Valadoc 0.52.5" "User Commands" +.TH VALADOC "1" "October 2021" "Valadoc 0.52.6" "User Commands" .SH NAME valadoc \- Vala Documentation Tool .SH SYNOPSIS diff --git a/doc/vapigen.1 b/doc/vapigen.1 index fc1760aa4..3a4f3d734 100644 --- a/doc/vapigen.1 +++ b/doc/vapigen.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.4. -.TH VAPIGEN "1" "August 2021" "Vala API Generator 0.52.5" "User Commands" +.TH VAPIGEN "1" "October 2021" "Vala API Generator 0.52.6" "User Commands" .SH NAME vapigen \- generate a Vala API .SH SYNOPSIS diff --git a/tests/Makefile.am b/tests/Makefile.am index 7c04805a9..9114ea972 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -39,9 +39,11 @@ AM_TESTS_ENVIRONMENT = \ TESTS = \ basic-types/gassert.vala \ + basic-types/integer-literals.vala \ basic-types/integers.vala \ basic-types/integers-boxed-cast.vala \ basic-types/escape-chars.vala \ + basic-types/float-literals.vala \ basic-types/floats.vala \ basic-types/floats-boxed-cast.vala \ basic-types/boolean.vala \ @@ -231,6 +233,7 @@ TESTS = \ methods/nowrapper-no-vfunc.test \ methods/params-array.vala \ methods/params-array-abstract.test \ + methods/params-array-multi-dimensional.test \ methods/params-array-preceding.test \ methods/params-array-with-throws.vala \ methods/print-attribute.vala \ @@ -397,6 +400,7 @@ TESTS = \ delegates/fields.vala \ delegates/fields-no-target.vala \ delegates/gclosure-conversion.vala \ + delegates/implicit-local-variable.vala \ delegates/incompatible.test \ delegates/incompatible-assignment.test \ delegates/incompatible-initializer.test \ @@ -696,6 +700,7 @@ TESTS = \ generics/parameter-invalid-initializer.test \ generics/parameter-sizeof-initializer.vala \ generics/member-dup-destroy.vala \ + generics/null-type.vala \ generics/property-int-cast.vala \ generics/reference-transfer.vala \ generics/string-literal-comparison.vala \ @@ -933,6 +938,7 @@ TESTS = \ semantic/assignment-signal-incompatible-type.test \ semantic/cast-gvalue-unsupported.test \ semantic/cast-gvariant-unsupported.test \ + semantic/cast-void-not-allowed.vala \ semantic/chainup-gobject-incompatible-type-property.test \ semantic/chainup-gobject-unknown-property.test \ semantic/chainup-gobject-unsupported-type-property.test \ @@ -1028,7 +1034,6 @@ TESTS = \ semantic/localvariable-var-static-access-instance-property.test \ semantic/localvariable-var-without-initializer.test \ semantic/localvariable-void.test \ - semantic/localvariable-void-initializer.test \ semantic/member-access-async-callback-invalid.test \ semantic/member-access-capture-out.test \ semantic/member-access-capture-valist-parameter.test \ diff --git a/tests/basic-types/float-literals.vala b/tests/basic-types/float-literals.vala new file mode 100644 index 000000000..b4bba83a4 --- /dev/null +++ b/tests/basic-types/float-literals.vala @@ -0,0 +1,14 @@ +void main () { + { + float foo = 23.42F; + float bar = 47.11f; + } + { + double foo = 23.42D; + double bar = 47.11d; + } + { + double foo = 23.42; + double bar = 47.11; + } +} diff --git a/tests/basic-types/garray.vala b/tests/basic-types/garray.vala index 9f09560a7..8732fa42f 100644 --- a/tests/basic-types/garray.vala +++ b/tests/basic-types/garray.vala @@ -89,9 +89,34 @@ void test_object_garray () { assert (foo.ref_count == 1); } +unowned Array check_gvalue_garray (Array vals) { + assert (vals.index (0) == "foo"); + assert (vals.index (1) == 42); + assert (vals.index (2) == 3.1415); + return vals; +} + +void test_gvalue_garray () { + { + var foo = new Array (); + foo.append_val ("foo"); + foo.append_val (42); + foo.append_val (3.1415); + check_gvalue_garray (foo); + } + { + Array foo = new Array (); + foo.append_val ("foo"); + foo.append_val (42); + foo.append_val (3.1415); + check_gvalue_garray (foo); + } +} + void main () { test_garray (); test_int_garray (); test_struct_garray (); test_object_garray (); + test_gvalue_garray (); } diff --git a/tests/basic-types/integer-literals.vala b/tests/basic-types/integer-literals.vala new file mode 100644 index 000000000..60deedbd8 --- /dev/null +++ b/tests/basic-types/integer-literals.vala @@ -0,0 +1,26 @@ +void main () { + { + uint foo = 23U; + uint bar = 42u; + } + { + int foo = 23; + int bar = 42; + } + { + ulong foo = 23UL; + ulong bar = 42ul; + } + { + long foo = 23L; + long bar = 42l; + } + { + uint64 foo = 23ULL; + uint64 bar = 42ull; + } + { + int64 foo = 23LL; + int64 bar = 42ll; + } +} diff --git a/tests/delegates/implicit-local-variable.vala b/tests/delegates/implicit-local-variable.vala new file mode 100644 index 000000000..ffe1d3175 --- /dev/null +++ b/tests/delegates/implicit-local-variable.vala @@ -0,0 +1,6 @@ +void main () { + SourceFuncs foo = { null, null, () => { return false; }, null }; + Source bar = null; + + foo.dispatch (bar, null); +} diff --git a/tests/generics/null-type.vala b/tests/generics/null-type.vala new file mode 100644 index 000000000..a427ee8c1 --- /dev/null +++ b/tests/generics/null-type.vala @@ -0,0 +1,10 @@ +void foo (T t) { + assert (t == null); + assert (typeof (T) == Type.INVALID); + assert (T.dup == null); + assert (T.destroy == null); +} + +void main () { + foo (null); +} diff --git a/tests/methods/params-array-multi-dimensional.test b/tests/methods/params-array-multi-dimensional.test new file mode 100644 index 000000000..d66d5abaf --- /dev/null +++ b/tests/methods/params-array-multi-dimensional.test @@ -0,0 +1,7 @@ +Invalid Code + +void foo (params string[,] strvv) { +} + +void main () { +} diff --git a/tests/objects/fields.vala b/tests/objects/fields.vala index 0872045bb..e14572bd9 100644 --- a/tests/objects/fields.vala +++ b/tests/objects/fields.vala @@ -32,6 +32,11 @@ class Faz : Foo { assert (private_class_field == 42); private_class_field = 24; assert (private_class_field == 24); + + assert (public_base_class_field == 42); + public_base_class_field = 24; + assert (public_base_class_field == 24); + public_base_class_field = 42; } static construct { @@ -42,6 +47,11 @@ class Faz : Foo { assert (private_class_field == 42); private_class_field = 24; assert (private_class_field == 24); + + assert (public_base_class_field == 42); + public_base_class_field = 24; + assert (public_base_class_field == 24); + public_base_class_field = 42; } public void action () { @@ -132,6 +142,11 @@ class Baz : Bar { assert (private_class_field == 42); private_class_field = 24; assert (private_class_field == 24); + + assert (public_base_class_field == 42); + public_base_class_field = 24; + assert (public_base_class_field == 24); + public_base_class_field = 42; } static construct { @@ -142,6 +157,11 @@ class Baz : Bar { assert (private_class_field == 42); private_class_field = 24; assert (private_class_field == 24); + + assert (public_base_class_field == 42); + public_base_class_field = 24; + assert (public_base_class_field == 24); + public_base_class_field = 42; } public void action () { diff --git a/tests/semantic/cast-void-not-allowed.vala b/tests/semantic/cast-void-not-allowed.vala new file mode 100644 index 000000000..dee3801de --- /dev/null +++ b/tests/semantic/cast-void-not-allowed.vala @@ -0,0 +1,11 @@ +bool success = false; + +bool foo () { + success = true; + return true; +} + +void main () { + (void) foo (); + assert (success); +} diff --git a/tests/semantic/class-opaque-automatic-property.vala b/tests/semantic/class-opaque-automatic-property.vala index 8400a78b5..893d03f42 100644 --- a/tests/semantic/class-opaque-automatic-property.vala +++ b/tests/semantic/class-opaque-automatic-property.vala @@ -1,10 +1,16 @@ [Compact (opaque = true)] public class Foo { public int bar { get; set; } + + public void manam () { + bar = 23; + assert (bar == 23); + } } void main () { var foo = new Foo (); + foo.manam (); foo.bar = 42; assert (foo.bar == 42); } diff --git a/tests/semantic/localvariable-void-initializer.test b/tests/semantic/localvariable-void-initializer.test deleted file mode 100644 index fbfbbff95..000000000 --- a/tests/semantic/localvariable-void-initializer.test +++ /dev/null @@ -1,5 +0,0 @@ -Invalid Code - -void main () { - var foo = (void) "foo"; -} diff --git a/vala/valacastexpression.vala b/vala/valacastexpression.vala index 9aff511fa..1d1dbb0f2 100644 --- a/vala/valacastexpression.vala +++ b/vala/valacastexpression.vala @@ -164,6 +164,13 @@ public class Vala.CastExpression : Expression { // FIXME: check whether cast is allowed + if (type_reference is VoidType) { + Report.warning (source_reference, "Casting to `void' is not supported"); + context.analyzer.replaced_nodes.add (this); + parent_node.replace_expression (this, inner); + return inner.check (context); + } + if (type_reference is DelegateType && inner.value_type is MethodType) { if (target_type != null) { inner.value_type.value_owned = target_type.value_owned; diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index b8751eca3..d0cebe6e4 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -232,10 +232,12 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression { type_reference = new ErrorType (null, null, source_reference); } else { type_reference = new ObjectType ((Class) type); + type_reference.source_reference = source_reference; } } else if (type_sym is Struct) { type = (TypeSymbol) type_sym; type_reference = new StructValueType ((Struct) type); + type_reference.source_reference = source_reference; } else if (type_sym is ErrorCode) { type = (TypeSymbol) type_sym; type_reference = new ErrorType ((ErrorDomain) type_sym.parent_symbol, (ErrorCode) type_sym, source_reference); diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index 41a59da61..7bbb2cedb 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -152,10 +152,16 @@ public class Vala.Parameter : Variable { if (!ellipsis) { variable_type.check (context); - if (params_array && !(variable_type is ArrayType)) { - error = true; - Report.error (source_reference, "parameter array expected"); - return false; + if (params_array) { + if (!(variable_type is ArrayType)) { + error = true; + Report.error (source_reference, "parameter array expected"); + return false; + } else if (((ArrayType) variable_type).rank != 1) { + error = true; + Report.error (source_reference, "multi-dimensional parameter array not allowed"); + return false; + } } if (has_attribute_argument ("CCode", "scope") && variable_type is DelegateType) { diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index ff6616449..550942269 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -1293,6 +1293,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor { } public void check_type (DataType type) { + // Allow any type-argument for GLib.Array + if (context != null && context.profile == Profile.GOBJECT + && type.type_symbol == garray_type.type_symbol) { + return; + } + foreach (var type_arg in type.get_type_arguments ()) { check_type (type_arg); check_type_argument (type_arg); @@ -1308,6 +1314,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { void check_type_argument (DataType type_arg) { if (type_arg is GenericType + || type_arg is NullType || type_arg is PointerType || type_arg is VoidType || is_reference_type_argument (type_arg) diff --git a/valadoc/icons/style.css b/valadoc/icons/style.css index a91c38a28..61d584c9e 100644 --- a/valadoc/icons/style.css +++ b/valadoc/icons/style.css @@ -329,6 +329,7 @@ h2, h3 { width: 16px; margin-right: 6px; vertical-align: middle; + padding-left: 0em !important; } .navi_main .abstract_class > a, .navi_inline .abstract_class > a { @@ -423,18 +424,24 @@ code { .brief_description a.abstract_class { background-image: url(abstractclass.svg); font-style: italic; + background-repeat: no-repeat; + padding-left: 1.5em; } .abstract_method::before, .description a.abstract_method, .brief_description a.abstract_method { background-image: url(abstractmethod.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .abstract_property::before, .description a.abstract_property, .brief_description a.abstract_property { background-image: url(abstractproperty.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .class::before, @@ -442,12 +449,16 @@ code { .description a.class, .brief_description a.class { background-image: url(class.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .constant::before, .description a.constant, .brief_description a.constant { background-image: url(constant.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .creation_method::before, @@ -466,6 +477,8 @@ code { .document::before { background-image: url(document.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .enum::before, @@ -486,6 +499,8 @@ code { .description a.errorcode, .brief_description a.errorcode { background-image: url(errorcode.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .errordomain::before, @@ -493,6 +508,8 @@ code { .description a.errordomain, .brief_description a.errordomain { background-image: url(errordomain.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .field::before, @@ -500,6 +517,8 @@ code { .description a.field, .brief_description a.field { background-image: url(field.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .interface::before, @@ -507,12 +526,16 @@ code { .description a.interface, .brief_description a.interface { background-image: url(interface.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .method::before, .description a.method, .brief_description a.method { background-image: url(method.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .namespace::before, @@ -520,14 +543,18 @@ code { .description a.namespace, .brief_description a.namespace { background-image: url(namespace.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .package::before { background-image: url(package.svg); + background-repeat: no-repeat; } .package_index::before { background-image: url(packages.svg); + background-repeat: no-repeat; } .property::before, @@ -535,6 +562,8 @@ code { .description a.property, .brief_description a.property { background-image: url(property.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .signal::before, @@ -542,12 +571,16 @@ code { .description a.signal, .brief_description a.signal { background-image: url(signal.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .static_method::before, .description a.static_method, .brief_description a.static_method { background-image: url(staticmethod.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .struct::before, @@ -555,16 +588,22 @@ code { .description a.struct, .brief_description a.struct { background-image: url(struct.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .virtual_method::before, .description a.virtual_method, .brief_description a.virtual_method { background-image: url(virtualmethod.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } .virtual_property::before, .description a.virtual_property, .brief_description a.virtual_property { background-image: url(virtualproperty.svg); + background-repeat: no-repeat; + padding-left: 1.5em; } diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index 35d197d4b..20ac0544f 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -1436,6 +1436,7 @@ namespace GLib { public unowned string get_name (); public int get_priority (); public GLib.Type get_type (); + public GLib.TypeClass ref_class (); } [CCode (cheader_filename = "gio/gio.h", has_type_id = false)] [Compact] @@ -1479,7 +1480,6 @@ namespace GLib { public class IOModule : GLib.TypeModule, GLib.TypePlugin { [CCode (has_construct_function = false)] public IOModule (string filename); - public void load (); [CCode (cheader_filename = "gio/gio.h", cname = "g_io_modules_load_all_in_directory")] public static GLib.List load_all_in_directory (string dirname); [CCode (cheader_filename = "gio/gio.h", cname = "g_io_modules_load_all_in_directory_with_scope")] @@ -1494,7 +1494,6 @@ namespace GLib { [CCode (cheader_filename = "gio/gio.h", cname = "g_io_modules_scan_all_in_directory_with_scope")] [Version (since = "2.30")] public static void scan_all_in_directory_with_scope (string dirname, GLib.IOModuleScope scope); - public void unload (); } [CCode (cheader_filename = "gio/gio.h", has_type_id = false)] [Compact] @@ -1808,6 +1807,8 @@ namespace GLib { [Version (since = "2.34")] public MenuItem.from_model (GLib.MenuModel model, int item_index); [Version (since = "2.34")] + public bool get_attribute (string attribute, string format_string, ...); + [Version (since = "2.34")] public GLib.Variant? get_attribute_value (string attribute, GLib.VariantType? expected_type); [Version (since = "2.34")] public GLib.MenuModel? get_link (string link); @@ -1968,9 +1969,11 @@ namespace GLib { [CCode (has_construct_function = false)] public Notification (string title); public void add_button (string label, string detailed_action); + public void add_button_with_target (string label, string action, string? target_format, ...); public void add_button_with_target_value (string label, string action, GLib.Variant? target); public void set_body (string? body); public void set_default_action (string detailed_action); + public void set_default_action_and_target (string action, string? target_format, ...); public void set_default_action_and_target_value (string action, GLib.Variant? target); public void set_icon (GLib.Icon icon); public void set_priority (GLib.NotificationPriority priority); @@ -1992,9 +1995,15 @@ namespace GLib { public bool is_closed (); [Version (since = "2.24")] public bool is_closing (); + [CCode (error_pos = 2.8, sentinel = "")] + [Version (since = "2.40")] + public bool printf (out size_t bytes_written, GLib.Cancellable? cancellable, string format, ...) throws GLib.Error; public bool set_pending () throws GLib.Error; public virtual ssize_t splice (GLib.InputStream source, GLib.OutputStreamSpliceFlags flags, GLib.Cancellable? cancellable = null) throws GLib.IOError; public virtual async ssize_t splice_async (GLib.InputStream source, GLib.OutputStreamSpliceFlags flags, int io_priority = GLib.Priority.DEFAULT, GLib.Cancellable? cancellable = null) throws GLib.IOError; + [CCode (error_pos = 2.8)] + [Version (since = "2.40")] + public bool vprintf (out size_t bytes_written, GLib.Cancellable? cancellable, string format, va_list args) throws GLib.Error; [CCode (vfunc_name = "write_fn")] public abstract ssize_t write ([CCode (array_length_cname = "count", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.IOError; public bool write_all ([CCode (array_length_cname = "count", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] buffer, out size_t bytes_written, GLib.Cancellable? cancellable = null) throws GLib.IOError; @@ -2302,6 +2311,9 @@ namespace GLib { public static GLib.SettingsBackend get_default (); [CCode (cheader_filename = "gio/gsettingsbackend.h", feature_test_macro = "G_SETTINGS_ENABLE_BACKEND")] [NoWrapper] + public virtual GLib.Permission get_permission (string path); + [CCode (cheader_filename = "gio/gsettingsbackend.h", feature_test_macro = "G_SETTINGS_ENABLE_BACKEND")] + [NoWrapper] public virtual bool get_writable (string key); [CCode (cheader_filename = "gio/gsettingsbackend.h", cname = "g_keyfile_settings_backend_new", feature_test_macro = "G_SETTINGS_ENABLE_BACKEND")] public static GLib.SettingsBackend keyfile_settings_backend_new (string filename, string root_path, string? root_group); @@ -2506,9 +2518,9 @@ namespace GLib { [Version (since = "2.36")] public class SimpleProxyResolver : GLib.Object, GLib.ProxyResolver { [CCode (has_construct_function = false, type = "GProxyResolver*")] - public SimpleProxyResolver (string? default_proxy, string? ignore_hosts); + public SimpleProxyResolver (string? default_proxy, [CCode (array_length = false, array_null_terminated = true)] string[]? ignore_hosts); public void set_default_proxy (string default_proxy); - public void set_ignore_hosts (string ignore_hosts); + public void set_ignore_hosts ([CCode (array_length = false, array_null_terminated = true)] string[] ignore_hosts); public void set_uri_proxy (string uri_scheme, string proxy); [NoAccessorMethod] public string default_proxy { owned get; set; } @@ -2850,6 +2862,8 @@ namespace GLib { public void set_stdin_file_path (string path); public void set_stdout_file_path (string? path); public void setenv (string variable, string value, bool overwrite); + [CCode (error_pos = 0.8)] + public GLib.Subprocess spawn (string argv0, ...) throws GLib.Error; public GLib.Subprocess spawnv ([CCode (array_length = false, array_null_terminated = true)] string[] argv) throws GLib.Error; public void take_fd (int source_fd, int target_fd); public void take_stderr_fd (int fd); @@ -3175,6 +3189,8 @@ namespace GLib { protected Vfs (); [NoWrapper] public virtual void add_writable_namespaces (GLib.FileAttributeInfoList list); + [NoWrapper] + public virtual GLib.Icon deserialize_icon (GLib.Variant value); public static unowned GLib.Vfs get_default (); public virtual GLib.File get_file_for_path (string path); public virtual GLib.File get_file_for_uri (string uri); @@ -4764,6 +4780,10 @@ namespace GLib { UNKNOWN_INTERFACE, UNKNOWN_PROPERTY, PROPERTY_READ_ONLY; + [CCode (error_pos = 0.8, sentinel = "")] + public static void set_dbus_error (string dbus_error_name, string dbus_error_message, string? format, ...) throws GLib.DBusError; + [CCode (error_pos = 0.8)] + public static void set_dbus_error_valist (string dbus_error_name, string dbus_error_message, string? format, va_list var_args) throws GLib.DBusError; [CCode (cheader_filename = "gio/gio.h")] public static string encode_gerror (GLib.Error error); [CCode (cheader_filename = "gio/gio.h")] diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 9ba837405..98d813922 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -1636,28 +1636,28 @@ namespace GLib { [CCode (lower_case_cprefix = "", cheader_filename = "math.h")] namespace Math { - [CCode (cname = "G_E")] + [CCode (cname = "G_E", cheader_filename = "glib.h")] public const double E; - [CCode (cname = "G_PI")] + [CCode (cname = "G_PI", cheader_filename = "glib.h")] public const double PI; - [CCode (cname = "G_LN2")] + [CCode (cname = "G_LN2", cheader_filename = "glib.h")] public const double LN2; - [CCode (cname = "G_LN10")] + [CCode (cname = "G_LN10", cheader_filename = "glib.h")] public const double LN10; - [CCode (cname = "G_PI_2")] + [CCode (cname = "G_PI_2", cheader_filename = "glib.h")] public const double PI_2; - [CCode (cname = "G_PI_4")] + [CCode (cname = "G_PI_4", cheader_filename = "glib.h")] public const double PI_4; - [CCode (cname = "G_SQRT2")] + [CCode (cname = "G_SQRT2", cheader_filename = "glib.h")] public const double SQRT2; - [CCode (cname = "G_LOG_2_BASE_10")] + [CCode (cname = "G_LOG_2_BASE_10", cheader_filename = "glib.h")] public const double LOG_2_BASE_10; /* generated from of glibc */ @@ -5423,6 +5423,22 @@ namespace GLib { /* Strings */ + [CCode (cprefix = "g_ref_string_", ref_function = "g_ref_string_acquire", unref_function = "g_ref_string_release", type_id = "G_TYPE_STRING")] + [Version (since = "2.58")] + public class RefString { + public RefString (string str); + public RefString.intern (string str); + public RefString.len (string str, ssize_t len); + + public size_t length { + [CCode (cname = "g_ref_string_length")] + get; + } + + [CCode (cname = "(const char*)")] + public unowned string to_string (); + } + [Compact] [GIR (name = "String")] [CCode (cname = "GString", cprefix = "g_string_", free_function = "g_string_free", type_id = "G_TYPE_GSTRING")] diff --git a/vapi/gtk4.vapi b/vapi/gtk4.vapi index 91062566c..d698551e3 100644 --- a/vapi/gtk4.vapi +++ b/vapi/gtk4.vapi @@ -4800,7 +4800,7 @@ namespace Gdk { public unowned Gdk.Display get_display (); public unowned Gdk.ContentFormats get_formats (); public bool is_local (); - public async GLib.InputStream? read_async (string mime_types, int io_priority, GLib.Cancellable? cancellable, out unowned string out_mime_type) throws GLib.Error; + public async GLib.InputStream? read_async ([CCode (array_length = false, array_null_terminated = true)] string[] mime_types, int io_priority, GLib.Cancellable? cancellable, out unowned string out_mime_type) throws GLib.Error; public async string? read_text_async (GLib.Cancellable? cancellable) throws GLib.Error; public async Gdk.Texture? read_texture_async (GLib.Cancellable? cancellable) throws GLib.Error; public async unowned GLib.Value? read_value_async (GLib.Type type, int io_priority, GLib.Cancellable? cancellable) throws GLib.Error; @@ -7634,10 +7634,10 @@ namespace Gtk { public class ConstraintGuide : GLib.Object, Gtk.ConstraintTarget { [CCode (has_construct_function = false)] public ConstraintGuide (); - public void get_max_size (int? width, int? height); - public void get_min_size (int? width, int? height); + public void get_max_size (out int width, out int height); + public void get_min_size (out int width, out int height); public unowned string? get_name (); - public void get_nat_size (int? width, int? height); + public void get_nat_size (out int width, out int height); public Gtk.ConstraintStrength get_strength (); public void set_max_size (int width, int height); public void set_min_size (int width, int height); @@ -12213,7 +12213,7 @@ namespace Gtk { public GLib.ListModel observe_controllers (); public unowned Gtk.Widget? pick (double x, double y, Gtk.PickFlags flags); [CCode (cname = "gtk_widget_class_query_action")] - public class bool query_action (uint index_, out GLib.Type owner, out string action_name, out GLib.VariantType? parameter_type, out string? property_name); + public class bool query_action (uint index_, out GLib.Type owner, out unowned string action_name, out unowned GLib.VariantType? parameter_type, out unowned string? property_name); public void queue_allocate (); public void queue_draw (); public void queue_resize (); diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala index 1b212271a..2264a984a 100644 --- a/vapi/metadata/Gio-2.0-custom.vala +++ b/vapi/metadata/Gio-2.0-custom.vala @@ -91,6 +91,15 @@ namespace GLib { public abstract GLib.Mount get_mount_for_mount_path (string mount_path, GLib.Cancellable? cancellable = null); } + public abstract class OutputStream : GLib.Object { + [Version (since = "2.40")] + [CCode (error_pos = 2.8, sentinel = "")] + public bool printf (out size_t bytes_written, GLib.Cancellable? cancellable, string format, ...) throws GLib.Error; + [Version (since = "2.40")] + [CCode (error_pos = 2.8)] + public bool vprintf (out size_t bytes_written, GLib.Cancellable? cancellable, string format, va_list args) throws GLib.Error; + } + [Compact] [CCode (cname = "GSource", ref_function = "g_source_ref", unref_function = "g_source_unref")] public class PollableSource : GLib.Source { @@ -124,6 +133,11 @@ namespace GLib { public void set_callback ([CCode (type = "GSourceFunc")] owned SocketSourceFunc func); } + public class SubprocessLauncher : GLib.Object { + [CCode (error_pos = 0.8)] + public GLib.Subprocess spawn (string argv0, ...) throws GLib.Error; + } + public class Task : GLib.Object { [CCode (has_construct_function = false)] [Version (since = "2.36")] @@ -164,6 +178,13 @@ namespace GLib { public virtual GLib.Icon? from_tokens (string[] tokens, int version) throws GLib.Error; } + public errordomain DBusError { + [CCode (error_pos = 0.8, sentinel = "")] + public static void set_dbus_error (string dbus_error_name, string dbus_error_message, string? format, ...) throws GLib.DBusError; + [CCode (error_pos = 0.8)] + public static void set_dbus_error_valist (string dbus_error_name, string dbus_error_message, string? format, va_list var_args) throws GLib.DBusError; + } + public errordomain IOError { [CCode (cname = "vala_g_io_error_from_errno")] public static GLib.IOError from_errno (int err_no) { diff --git a/vapi/metadata/Gio-2.0.metadata b/vapi/metadata/Gio-2.0.metadata index 51ba44821..fcbb74109 100644 --- a/vapi/metadata/Gio-2.0.metadata +++ b/vapi/metadata/Gio-2.0.metadata @@ -57,6 +57,7 @@ SettingsBackend .* cheader_filename="gio/gsettingsbackend.h" feature_test_macro="G_SETTINGS_ENABLE_BACKEND" .changed_tree.tree type="GLib.Tree" .flatten_tree.tree type="GLib.Tree" + .get_permission unowned=false skip=false .write_tree.tree type="GLib.Tree" Action @@ -133,6 +134,10 @@ File .monitor_dir* throws="GLib.IOError" .monitor_file throws="GLib.IOError" .replace_contents_bytes_async finish_name="g_file_replace_contents_finish" +IOExtension + .ref_class skip=false +IOModuleScope + .new skip=false symbol_type="constructor" io_error_from_errno type="int" name="io_error__from_errno" IOStream .close virtual vfunc_name="close_fn" throws="GLib.IOError" @@ -173,6 +178,7 @@ MemoryOutputStream .destroy_function skip=false type="GLib.DestroyNotify?" .realloc_function skip=false type="GLib.ReallocFunc?" MenuItem + .get_attribute skip=false .set_action_and_target skip=false .set_attribute skip=false MenuModel @@ -180,6 +186,9 @@ MenuModel .get_item_attributes.attributes out type="GLib.HashTable?" Mount .get_sort_key#virtual_method virtual +Notification + .add_button_with_target skip=false + .set_default_action_and_target skip=false OutputStream .close abstract vfunc_name="close_fn" throws="GLib.IOError" .close_finish throws="GLib.IOError" @@ -252,6 +261,7 @@ TlsPassword .set_value#virtual_method.value owned .set_value#virtual_method.destroy default=GLib.free Vfs + .deserialize_icon skip=false unowned=false // TODO: should probably be a simple generic .local_file_add_info.extra_data default=null .local_file_add_info.free_extra_data nullable default=null