[vala/wip/gobject-2.0: 6/8] TypeInstance and TypeClass are the base of them all
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/gobject-2.0: 6/8] TypeInstance and TypeClass are the base of them all
- Date: Tue, 30 Nov 2021 16:39:54 +0000 (UTC)
commit ae1fd25d4521040a1af4de83611802c2c03a2edb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Sep 21 10:25:38 2019 +0200
TypeInstance and TypeClass are the base of them all
vapi/gobject-2.0.vapi | 25 ++++++++++++++-----------
vapi/metadata/GObject-2.0-custom.vala | 10 +++++++++-
vapi/metadata/GObject-2.0.metadata | 5 +++++
3 files changed, 28 insertions(+), 12 deletions(-)
---
diff --git a/vapi/gobject-2.0.vapi b/vapi/gobject-2.0.vapi
index 587f70339..ef72a25d8 100644
--- a/vapi/gobject-2.0.vapi
+++ b/vapi/gobject-2.0.vapi
@@ -121,7 +121,7 @@ namespace GLib {
protected InitiallyUnowned ();
}
[CCode (cheader_filename = "glib-object.h", get_value_function = "g_value_get_object",
marshaller_type_name = "OBJECT", param_spec_function = "g_param_spec_object", ref_function = "g_object_ref",
set_value_function = "g_value_set_object", take_value_function = "g_value_take_object", type_id =
"g_object_get_type ()", unref_function = "g_object_unref")]
- public class Object {
+ public class Object : GLib.TypeInstance {
public GLib.TypeInstance g_type_instance;
public GLib.Datalist qdata;
public uint ref_count;
@@ -453,9 +453,10 @@ namespace GLib {
public ParamSpecVariant (string name, string nick, string blurb, GLib.VariantType type, owned
GLib.Variant? default_value, GLib.ParamFlags flags);
}
[CCode (cheader_filename = "glib-object.h", has_type_id = false)]
- [Compact]
- public class TypeClass {
+ public abstract class TypeClass {
public GLib.Type g_type;
+ [CCode (has_construct_function = false)]
+ protected TypeClass ();
[CCode (cname = "g_type_class_add_private")]
[Version (deprecated = true, deprecated_since = "2.58", since = "2.4")]
public void add_private (size_t private_size);
@@ -471,6 +472,14 @@ namespace GLib {
[CCode (cname = "g_type_class_unref_uncached")]
public void unref_uncached ();
}
+ [CCode (cheader_filename = "glib-object.h", has_type_id = false)]
+ public abstract class TypeInstance {
+ public GLib.TypeClass g_class;
+ [CCode (has_construct_function = false)]
+ protected TypeInstance ();
+ [CCode (cname = "g_type_instance_get_private")]
+ public void* get_private (GLib.Type private_type);
+ }
[CCode (cheader_filename = "glib-object.h", copy_function = "g_boxed_copy", free_function =
"g_boxed_free", type_id = "g_value_array_get_type ()")]
[Compact]
public class ValueArray {
@@ -629,7 +638,7 @@ namespace GLib {
public static unowned GLib.TypeClass check_class_cast (GLib.TypeClass g_class, GLib.Type
is_a_type);
public static bool check_class_is_a (GLib.TypeClass g_class, GLib.Type is_a_type);
public static bool check_instance (GLib.TypeInstance instance);
- public static unowned GLib.TypeInstance? check_instance_cast (GLib.TypeInstance instance,
GLib.Type iface_type);
+ public static unowned GLib.TypeInstance check_instance_cast (GLib.TypeInstance instance,
GLib.Type iface_type);
public static bool check_instance_is_a (GLib.TypeInstance instance, GLib.Type iface_type);
public static bool check_instance_is_fundamentally_a (GLib.TypeInstance instance, GLib.Type
fundamental_type);
public static bool check_is_value_type (GLib.Type type);
@@ -642,7 +651,7 @@ namespace GLib {
[Version (since = "2.4")]
public static unowned GLib.TypeClass class_peek_static (GLib.Type type);
public static unowned GLib.TypeClass class_ref (GLib.Type type);
- public static unowned GLib.TypeInstance? create_instance (GLib.Type type);
+ public static unowned GLib.TypeInstance create_instance (GLib.Type type);
[Version (since = "2.4")]
public static unowned GLib.TypeInterface? default_interface_peek (GLib.Type g_type);
[Version (since = "2.4")]
@@ -717,12 +726,6 @@ namespace GLib {
public GLib.TypeValueTable value_table;
}
[CCode (cheader_filename = "glib-object.h", has_type_id = false)]
- public struct TypeInstance {
- public weak GLib.TypeClass g_class;
- [CCode (cname = "g_type_instance_get_private")]
- public void* get_private (GLib.Type private_type);
- }
- [CCode (cheader_filename = "glib-object.h", has_type_id = false)]
public struct TypeInterface {
public GLib.Type g_type;
public GLib.Type g_instance_type;
diff --git a/vapi/metadata/GObject-2.0-custom.vala b/vapi/metadata/GObject-2.0-custom.vala
index 01e60df3e..3540ab988 100644
--- a/vapi/metadata/GObject-2.0-custom.vala
+++ b/vapi/metadata/GObject-2.0-custom.vala
@@ -1,6 +1,6 @@
namespace GLib {
[CCode (cheader_filename = "glib-object.h", get_value_function = "g_value_get_object",
marshaller_type_name = "OBJECT", param_spec_function = "g_param_spec_object", ref_function = "g_object_ref",
set_value_function = "g_value_set_object", take_value_function = "g_value_take_object", unref_function =
"g_object_unref")]
- public class Object {
+ public class Object : TypeInstance {
}
[CCode (get_value_function = "g_value_get_param", param_spec_function = "g_param_spec_param",
ref_function = "g_param_spec_ref", set_value_function = "g_value_set_param", take_value_function =
"g_value_take_param", type_id = "G_TYPE_PARAM", unref_function = "g_param_spec_unref")]
@@ -14,6 +14,14 @@ namespace GLib {
public weak GLib.EnumClass enum_class;
}
+ [CCode (cheader_filename = "glib-object.h", has_type_id = false)]
+ public abstract class TypeClass {
+ }
+
+ [CCode (cheader_filename = "glib-object.h", has_type_id = false)]
+ public abstract class TypeInstance {
+ }
+
[CCode (cheader_filename = "glib-object.h", cname = "guint")]
public struct Signal : uint {
}
diff --git a/vapi/metadata/GObject-2.0.metadata b/vapi/metadata/GObject-2.0.metadata
index 52fb5b604..ff9a1d3af 100644
--- a/vapi/metadata/GObject-2.0.metadata
+++ b/vapi/metadata/GObject-2.0.metadata
@@ -8,6 +8,11 @@ cclosure_* skip
signal_type_cclosure_new skip
VaClosureMarshal skip=false
+*.g_class unowned=false
+*.g_type_instance unowned=false
+
+TypeInstance struct=false
+
Object.get_property#virtual_method skip
Object.set_property#virtual_method skip
Object.dispatch_properties_changed skip
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]