[vala/0.46] gtk4: Constructors of Gtk.MediaFile needs to be static functions



commit 6bab0192d51a6bd441d1466214a321364531a6d6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jul 15 15:22:40 2019 +0200

    gtk4: Constructors of Gtk.MediaFile needs to be static functions

 vapi/gtk4.vapi                 | 22 ++++++++++++----------
 vapi/metadata/Gtk-4.0.metadata |  5 +++++
 2 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/vapi/gtk4.vapi b/vapi/gtk4.vapi
index 07ab9b1c3..00f4c7760 100644
--- a/vapi/gtk4.vapi
+++ b/vapi/gtk4.vapi
@@ -8992,19 +8992,21 @@ namespace Gtk {
        }
        [CCode (cheader_filename = "gtk/gtk.h", type_id = "gtk_media_file_get_type ()")]
        public abstract class MediaFile : Gtk.MediaStream, Gdk.Paintable {
-               [CCode (has_construct_function = false, type = "GtkMediaStream*")]
-               public MediaFile ();
+               [CCode (has_construct_function = false)]
+               protected MediaFile ();
                public void clear ();
                [NoWrapper]
                public virtual void close ();
-               [CCode (has_construct_function = false, type = "GtkMediaStream*")]
-               public MediaFile.for_file (GLib.File file);
-               [CCode (has_construct_function = false, type = "GtkMediaStream*")]
-               public MediaFile.for_filename (string filename);
-               [CCode (has_construct_function = false, type = "GtkMediaStream*")]
-               public MediaFile.for_input_stream (GLib.InputStream stream);
-               [CCode (has_construct_function = false, type = "GtkMediaStream*")]
-               public MediaFile.for_resource (string resource_path);
+               [CCode (cname = "gtk_media_file_new")]
+               public static Gtk.MediaFile empty ();
+               [CCode (cname = "gtk_media_file_new_for_file")]
+               public static Gtk.MediaFile for_file (GLib.File file);
+               [CCode (cname = "gtk_media_file_new_for_filename")]
+               public static Gtk.MediaFile for_filename (string filename);
+               [CCode (cname = "gtk_media_file_new_for_input_stream")]
+               public static Gtk.MediaFile for_input_stream (GLib.InputStream stream);
+               [CCode (cname = "gtk_media_file_new_for_resource")]
+               public static Gtk.MediaFile for_resource (string resource_path);
                public unowned GLib.File? get_file ();
                public unowned GLib.InputStream? get_input_stream ();
                [NoWrapper]
diff --git a/vapi/metadata/Gtk-4.0.metadata b/vapi/metadata/Gtk-4.0.metadata
index eee9e8e2c..b43896b5a 100644
--- a/vapi/metadata/Gtk-4.0.metadata
+++ b/vapi/metadata/Gtk-4.0.metadata
@@ -61,6 +61,11 @@ TreeStore
 CellRenderer
   .get_size replacement="get_preferred_size"
 
+// Factory method of abstract type
+MediaFile
+  .new* symbol_type="function" name="new_(.+)" ctype="GtkMediaStream*"
+  .new name="empty"
+
 // G-I cannot deprecate whole types
 
 // G-I cannot handle returning non-boxed types


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