[vala/wip/issue/1222] gio-2.0: Unhide a few usable symbols which are marked not introspectable




commit 6ad11279231bb819b286451e2116d8202e13af92
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Sep 7 09:51:06 2021 +0200

    gio-2.0: Unhide a few usable symbols which are marked not introspectable
    
    Fixes https://gitlab.gnome.org/GNOME/vala/issues/1222

 vapi/gio-2.0.vapi                 | 22 ++++++++++++++++++++++
 vapi/metadata/Gio-2.0-custom.vala | 27 +++++++++++++++++++++------
 vapi/metadata/Gio-2.0.metadata    | 10 ++++++++++
 3 files changed, 53 insertions(+), 6 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index b3a24f38d..651b2dab7 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -1483,6 +1483,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]
@@ -1855,6 +1856,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);
@@ -2015,11 +2018,13 @@ 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);
                [Version (since = "2.70")]
                public void set_category (string? category);
                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);
@@ -2041,9 +2046,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;
@@ -2352,6 +2363,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);
@@ -2899,6 +2913,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);
@@ -3256,6 +3272,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);
@@ -4878,6 +4896,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;
                public static string encode_gerror (GLib.Error error);
                public static string? get_remote_error (GLib.Error error);
                public static bool is_remote_error (GLib.Error error);
diff --git a/vapi/metadata/Gio-2.0-custom.vala b/vapi/metadata/Gio-2.0-custom.vala
index 95952ffc2..9b3b83c5e 100644
--- a/vapi/metadata/Gio-2.0-custom.vala
+++ b/vapi/metadata/Gio-2.0-custom.vala
@@ -84,12 +84,6 @@ namespace GLib {
                public GLib.MainContext context { construct; }
        }
 
-       [Compact]
-       public class IOModuleScope {
-               [CCode (has_construct_function = false)]
-               public IOModuleScope (GLib.IOModuleScopeFlags flags);
-       }
-
        public class MemoryOutputStream : GLib.OutputStream {
                [CCode (has_construct_function = false, type = "GOutputStream*")]
                public MemoryOutputStream ([CCode (array_length_type = "gsize")] owned uint8[]? data, 
GLib.ReallocFunc? realloc_function = GLib.g_realloc, GLib.DestroyNotify? destroy_function = GLib.g_free);
@@ -100,6 +94,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 {
@@ -133,6 +136,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")]
@@ -173,6 +181,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 637c5dc55..18ea8c8f1 100644
--- a/vapi/metadata/Gio-2.0.metadata
+++ b/vapi/metadata/Gio-2.0.metadata
@@ -56,6 +56,7 @@ SettingsBackend
   .* cheader_filename="gio/gsettingsbackend.h" feature_test_macro="G_SETTINGS_ENABLE_BACKEND"
   .changed_tree.tree type="GLib.Tree<string,GLib.Variant>"
   .flatten_tree.tree type="GLib.Tree<string,GLib.Variant>"
+  .get_permission unowned=false skip=false
   .write_tree.tree type="GLib.Tree<string,GLib.Variant>"
 
 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<string,GLib.Variant>?"
 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]