[vala/0.40] libvaladoc: Add type_id to Api.Enum/Interface
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] libvaladoc: Add type_id to Api.Enum/Interface
- Date: Thu, 6 Dec 2018 13:10:54 +0000 (UTC)
commit 370b7bc23b1c452e0c0817e5a8f315c3e5a59646
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Nov 14 19:55:43 2018 +0100
libvaladoc: Add type_id to Api.Enum/Interface
libvaladoc/api/enum.vala | 9 +++++++++
libvaladoc/api/interface.vala | 10 +++++++++-
libvaladoc/ctyperesolver.vala | 2 ++
3 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/libvaladoc/api/enum.vala b/libvaladoc/api/enum.vala
index cbadb1971..d861c755d 100644
--- a/libvaladoc/api/enum.vala
+++ b/libvaladoc/api/enum.vala
@@ -28,6 +28,7 @@ using Valadoc.Content;
*/
public class Valadoc.Api.Enum : TypeSymbol {
private string cname;
+ private string? type_id;
public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
SourceComment? comment, string? cname, string? type_macro_name,
@@ -36,6 +37,7 @@ public class Valadoc.Api.Enum : TypeSymbol {
base (parent, file, name, accessibility, comment, type_macro_name, null, null,
type_function_name, false, data);
this.cname = cname;
+ this.type_id = Vala.get_ccode_type_id ((Vala.CodeNode) data);
}
/**
@@ -45,6 +47,13 @@ public class Valadoc.Api.Enum : TypeSymbol {
return cname;
}
+ /**
+ * Returns the C symbol representing the runtime type id for this data type.
+ */
+ public string? get_type_id () {
+ return type_id;
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/libvaladoc/api/interface.vala b/libvaladoc/api/interface.vala
index ede696cf9..230fc89e5 100644
--- a/libvaladoc/api/interface.vala
+++ b/libvaladoc/api/interface.vala
@@ -30,7 +30,7 @@ public class Valadoc.Api.Interface : TypeSymbol {
private string? interface_macro_name;
private string? dbus_name;
private string? cname;
-
+ private string? type_id;
public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility,
SourceComment? comment, string? cname, string? type_macro_name,
string? is_type_macro_name,
@@ -43,6 +43,7 @@ public class Valadoc.Api.Interface : TypeSymbol {
this.interface_macro_name = interface_macro_name;
this.dbus_name = dbus_name;
this.cname = cname;
+ this.type_id = Vala.get_ccode_type_id ((Vala.CodeNode) data);
}
/**
@@ -93,6 +94,13 @@ public class Valadoc.Api.Interface : TypeSymbol {
return cname;
}
+ /**
+ * Returns the C symbol representing the runtime type id for this data type.
+ */
+ public string? get_type_id () {
+ return type_id;
+ }
+
/**
* Returns the dbus-name.
*/
diff --git a/libvaladoc/ctyperesolver.vala b/libvaladoc/ctyperesolver.vala
index e6444e0ae..e01785435 100644
--- a/libvaladoc/ctyperesolver.vala
+++ b/libvaladoc/ctyperesolver.vala
@@ -226,6 +226,7 @@ public class Valadoc.CTypeResolver : Visitor {
* {@inheritDoc}
*/
public override void visit_interface (Interface item) {
+ register_symbol_type (item.get_type_id (), item);
register_symbol (item.get_cname (), item);
item.accept_all_children (this, false);
}
@@ -391,6 +392,7 @@ public class Valadoc.CTypeResolver : Visitor {
* {@inheritDoc}
*/
public override void visit_enum (Api.Enum item) {
+ register_symbol_type (item.get_type_id (), item);
register_symbol (item.get_cname (), item);
item.accept_all_children (this, false);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]