From bc42910d12c0ae257e7015d8ed25fbaf27486a0d Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Mon, 15 Jul 2019 15:22:40 +0200 Subject: [PATCH] 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 5532c94e2..b22b49732 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 -- 2.47.2