Commit 2afd6ebb authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Add type_id to Api.Enum/Interface

parent 0c989746
......@@ -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 (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}
*/
......
......@@ -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 (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.
*/
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment