[valadoc] libvaladoc: Add metadata for gtkdoclet
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] libvaladoc: Add metadata for gtkdoclet
- Date: Fri, 17 Aug 2012 23:24:49 +0000 (UTC)
commit ea630c53ad06b868112d6b23fb7feeb632538731
Author: Florian Brosch <flo brosch gmail com>
Date: Thu Aug 16 03:30:35 2012 +0200
libvaladoc: Add metadata for gtkdoclet
src/driver/0.10.x/treebuilder.vala | 107 ++++++++++++--
src/driver/0.12.x/treebuilder.vala | 88 +++++++++++-
src/driver/0.14.x/treebuilder.vala | 127 ++++++++++++++++-
src/driver/0.16.x/treebuilder.vala | 82 ++++++++++-
src/driver/0.18.x/treebuilder.vala | 81 ++++++++++-
src/libvaladoc/api/class.vala | 41 +++++-
src/libvaladoc/api/delegate.vala | 2 +-
src/libvaladoc/api/enum.vala | 4 +-
src/libvaladoc/api/errordomain.vala | 22 +++-
src/libvaladoc/api/interface.vala | 14 ++-
src/libvaladoc/api/struct.vala | 4 +-
src/libvaladoc/api/typesymbol.vala | 39 +++++-
tests/{ => drivers}/generic-api-test.vala | 152 ++++++++++----------
.../parser/generic-scanner.vala} | 0
tests/testrunner.sh | 2 +-
15 files changed, 639 insertions(+), 126 deletions(-)
---
diff --git a/src/driver/0.10.x/treebuilder.vala b/src/driver/0.10.x/treebuilder.vala
index 567f1dc..029a5f1 100644
--- a/src/driver/0.10.x/treebuilder.vala
+++ b/src/driver/0.10.x/treebuilder.vala
@@ -238,16 +238,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
}
}
- private SourceComment? create_comment (Vala.Comment? comment) {
- if (comment != null) {
- Vala.SourceReference pos = comment.source_reference;
- SourceFile file = files.get (pos.file);
- return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
- }
-
- return null;
- }
-
private string get_method_name (Vala.Method element) {
if (element is Vala.CreationMethod) {
if (element.name == ".new") {
@@ -260,6 +250,93 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return element.name;
}
+ private string? get_quark_macro_name (Vala.ErrorDomain element) {
+ return element.get_upper_case_cname ();
+ }
+
+ private string? get_private_cname (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ string? cname = element.get_cname ();
+ return (cname != null)? cname + "Private" : null;
+ }
+
+ private string? get_class_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_GET_CLASS".printf (element.get_upper_case_cname ());
+ }
+
+ private string? get_class_type_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_CLASS".printf (element.get_upper_case_cname ());
+ }
+
+ private string? get_is_type_macro_name (Vala.TypeSymbol element) {
+ var cl = element as Vala.Class;
+ if (cl != null && cl.type_check_function != null) {
+ return cl.type_check_function;
+ } else if ((cl != null && cl.is_compact) || element is Vala.Struct || element is Vala.Enum || element is Vala.Delegate) {
+ return null;
+ } else {
+ return element.get_upper_case_cname ("IS_");
+ }
+ }
+
+ private string? get_is_class_type_macro_name (Vala.TypeSymbol element) {
+ string? name = get_is_type_macro_name (element);
+ return (name != null)? name + "_CLASS" : null;
+ }
+
+ private string? get_type_function_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return "%s_get_type".printf (element.get_lower_case_cname ());
+ }
+
+ private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+ return element.get_upper_case_cname ();
+ } else {
+ return null;
+ }
+ }
+
+ private string? get_type_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return element.get_type_id ();
+ }
+
+ private string? get_interface_macro_name (Vala.Interface element) {
+ return "%s_GET_INTERFACE".printf (element.get_upper_case_cname ());
+ }
+
+ private string get_quark_function_name (Vala.ErrorDomain element) {
+ return element.get_lower_case_cprefix () + "quark";
+ }
+
+ private SourceComment? create_comment (Vala.Comment? comment) {
+ if (comment != null) {
+ Vala.SourceReference pos = comment.source_reference;
+ SourceFile file = files.get (pos.file);
+ return new SourceComment (comment.content, file, pos.first_line, pos.first_column, pos.last_line, pos.last_column);
+ }
+
+ return null;
+ }
+
private PackageMetaData? get_package_meta_data (Package pkg) {
foreach (PackageMetaData data in packages) {
if (data.package == pkg) {
@@ -783,7 +860,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, element.get_cname (), Vala.GDBusModule.get_dbus_name (element), element.get_type_id (), element.get_param_spec_function (), element.get_ref_function (), element.get_unref_function (), element.get_take_value_function (), element.get_get_value_function (), element.get_set_value_function (), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, element.get_cname (), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element.get_type_id (), element.get_param_spec_function (), element.get_ref_function (), element.get_unref_function (), element.get_take_value_function (), element.get_get_value_function (), element.get_set_value_function (), element.is_fundamental (), element.is_abstract, is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -815,7 +892,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -843,7 +920,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, element.get_cname(), element.get_type_id (), element.get_dup_function (), element.get_free_function (), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, element.get_cname(), get_type_macro_name (element), get_type_function_name (element), element.get_type_id (), element.get_dup_function (), element.get_free_function (), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -978,7 +1055,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Api.Enum (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), element);
+ Symbol node = new Api.Enum (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), get_type_macro_name (element), get_type_function_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1027,7 +1104,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier(element), comment, element.get_cname(), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, element.get_cname (), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.12.x/treebuilder.vala b/src/driver/0.12.x/treebuilder.vala
index 9f28074..4423299 100644
--- a/src/driver/0.12.x/treebuilder.vala
+++ b/src/driver/0.12.x/treebuilder.vala
@@ -240,6 +240,83 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
}
}
+ private string? get_quark_macro_name (Vala.ErrorDomain element) {
+ return element.get_upper_case_cname ();
+ }
+
+ private string? get_private_cname (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ string? cname = element.get_cname ();
+ return (cname != null)? cname + "Private" : null;
+ }
+
+ private string? get_class_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_GET_CLASS".printf (element.get_upper_case_cname ());
+ }
+
+ private string? get_class_type_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_CLASS".printf (element.get_upper_case_cname ());
+ }
+
+ private string? get_is_type_macro_name (Vala.TypeSymbol element) {
+ var cl = element as Vala.Class;
+ if (cl != null && cl.type_check_function != null) {
+ return cl.type_check_function;
+ } else if ((cl != null && cl.is_compact) || element is Vala.Struct || element is Vala.Enum || element is Vala.Delegate) {
+ return null;
+ } else {
+ return element.get_upper_case_cname ("IS_");
+ }
+ }
+
+ private string? get_is_class_type_macro_name (Vala.TypeSymbol element) {
+ string? name = get_is_type_macro_name (element);
+ return (name != null)? name + "_CLASS" : null;
+ }
+
+ private string? get_type_function_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return "%s_get_type".printf (element.get_lower_case_cname ());
+ }
+
+ private string? get_type_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return element.get_type_id ();
+ }
+
+ private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+ return element.get_upper_case_cname ();
+ } else {
+ return null;
+ }
+ }
+
+ private string? get_interface_macro_name (Vala.Interface element) {
+ return "%s_GET_INTERFACE".printf (element.get_upper_case_cname ());
+ }
+
+ private string get_quark_function_name (Vala.ErrorDomain element) {
+ return element.get_lower_case_cprefix () + "quark";
+ }
+
private SourceComment? create_comment (Vala.Comment? comment) {
if (comment != null) {
Vala.SourceReference pos = comment.source_reference;
@@ -834,7 +911,8 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), Vala.GDBusModule.get_dbus_name (element), element.get_type_id (), element.get_param_spec_function (), element.get_ref_function (), element.get_unref_function (), element.get_take_value_function (), element.get_get_value_function (), element.get_set_value_function (), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, element.get_cname (), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element.get_type_id (), element.get_param_spec_function (), element.get_ref_function (), element.get_unref_function (), element.get_take_value_function (), element.get_get_value_function (), element.get_set_value_function (), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+
symbol_map.set (element, node);
parent.add_child (node);
@@ -866,7 +944,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -894,7 +972,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment, element.get_cname(), element.get_type_id (), element.get_dup_function (), element.get_free_function (), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment, element.get_cname(), get_type_macro_name (element), get_type_function_name (element), element.get_type_id (), element.get_dup_function (), element.get_free_function (), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1034,7 +1112,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), element);
+ Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, element.get_cname (), get_type_macro_name (element), get_type_function_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1083,7 +1161,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier(element), comment, element.get_cname(), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, element.get_cname (), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.14.x/treebuilder.vala b/src/driver/0.14.x/treebuilder.vala
index e0f64e6..022679b 100644
--- a/src/driver/0.14.x/treebuilder.vala
+++ b/src/driver/0.14.x/treebuilder.vala
@@ -358,7 +358,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
} else if (symbol is Vala.Field) {
return ((Vala.Field) symbol).get_cname ();
} else {
-message ("--%s--", symbol.name);
assert_not_reached ();
}
#else
@@ -366,6 +365,121 @@ message ("--%s--", symbol.name);
#endif
}
+ private string? get_quark_macro_name (Vala.ErrorDomain element) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return element.get_upper_case_cname ();
+#else
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+#endif
+ }
+
+ private string? get_private_cname (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ string? cname = get_cname (element);
+ return (cname != null)? cname + "Private" : null;
+ }
+
+ private string? get_class_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+#if VALA_0_13_0 || VALA_0_13_1
+ return "%s_GET_CLASS".printf (element.get_upper_case_cname ());
+#else
+ return "%s_GET_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+#endif
+ }
+
+ private string? get_class_type_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+#if VALA_0_13_0 || VALA_0_13_1
+ return "%s_CLASS".printf (element.get_upper_case_cname ());
+#else
+ return "%s_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+#endif
+ }
+
+ private string? get_is_type_macro_name (Vala.TypeSymbol element) {
+#if VALA_0_13_0 || VALA_0_13_1
+ var cl = element as Vala.Class;
+ if (cl != null && cl.type_check_function != null) {
+ return cl.type_check_function;
+ } else if ((cl != null && cl.is_compact) || element is Vala.Struct || element is Vala.Enum || element is Vala.Delegate) {
+ return null;
+ } else {
+ return element.get_upper_case_cname ("IS_");
+ }
+#else
+ string? name = Vala.CCodeBaseModule.get_ccode_type_check_function (element);
+ return (name != null && name != "")? name : null;
+#endif
+ }
+
+ private string? get_is_class_type_macro_name (Vala.TypeSymbol element) {
+ string? name = get_is_type_macro_name (element);
+ return (name != null)? name + "_CLASS" : null;
+ }
+
+ private string? get_type_function_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+#if VALA_0_13_0 || VALA_0_13_1
+ return "%s_get_type".printf (element.get_lower_case_cname ());
+#else
+ return "%s_get_type".printf (Vala.CCodeBaseModule.get_ccode_lower_case_name (element, null));
+#endif
+ }
+
+ private string? get_type_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+
+#if VALA_0_13_0 || VALA_0_13_1
+ return element.get_type_id ();
+#else
+ return Vala.CCodeBaseModule.get_ccode_type_id (element);
+#endif
+ }
+
+ private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return element.get_upper_case_cname ();
+#else
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+#endif
+ } else {
+ return null;
+ }
+ }
+
+ private string? get_interface_macro_name (Vala.Interface element) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return "%s_GET_INTERFACE".printf (element.get_upper_case_cname ());
+#else
+ return "%s_GET_INTERFACE".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+#endif
+ }
+
+ private string get_quark_function_name (Vala.ErrorDomain element) {
+#if VALA_0_13_0 || VALA_0_13_1
+ return element.get_lower_case_cprefix () + "quark";
+#else
+ return Vala.CCodeBaseModule.get_ccode_lower_case_prefix (element) + "quark";
+#endif
+ }
+
private SourceComment? create_comment (Vala.Comment? comment) {
if (comment != null) {
Vala.SourceReference pos = comment.source_reference;
@@ -901,7 +1015,8 @@ message ("--%s--", symbol.name);
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+
symbol_map.set (element, node);
parent.add_child (node);
@@ -933,7 +1048,7 @@ message ("--%s--", symbol.name);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -961,7 +1076,7 @@ message ("--%s--", symbol.name);
bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1096,7 +1211,7 @@ message ("--%s--", symbol.name);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1145,7 +1260,7 @@ message ("--%s--", symbol.name);
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.16.x/treebuilder.vala b/src/driver/0.16.x/treebuilder.vala
index b738596..99ac936 100644
--- a/src/driver/0.16.x/treebuilder.vala
+++ b/src/driver/0.16.x/treebuilder.vala
@@ -297,6 +297,77 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return Vala.CCodeBaseModule.get_ccode_name (symbol);
}
+ private string? get_quark_macro_name (Vala.ErrorDomain element) {
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+ }
+
+ private string? get_private_cname (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ string? cname = get_cname (element);
+ return (cname != null)? cname + "Private" : null;
+ }
+
+ private string? get_class_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_GET_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string? get_class_type_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string? get_is_type_macro_name (Vala.TypeSymbol element) {
+ string name = Vala.CCodeBaseModule.get_ccode_type_check_function (element);
+ return (name != null && name != "")? name : null;
+ }
+
+ private string? get_is_class_type_macro_name (Vala.TypeSymbol element) {
+ string? name = get_is_type_macro_name (element);
+ return (name != null)? name + "_CLASS" : null;
+ }
+
+ private string? get_type_function_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return "%s_get_type".printf (Vala.CCodeBaseModule.get_ccode_lower_case_name (element, null));
+ }
+
+ private string? get_type_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return Vala.CCodeBaseModule.get_ccode_type_id (element);
+ }
+
+ private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+ } else {
+ return null;
+ }
+ }
+
+ private string? get_interface_macro_name (Vala.Interface element) {
+ return "%s_GET_INTERFACE".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string get_quark_function_name (Vala.ErrorDomain element) {
+ return Vala.CCodeBaseModule.get_ccode_lower_case_prefix (element) + "quark";
+ }
+
private SourceComment? create_comment (Vala.Comment? comment) {
#if VALA_0_15_0
if (comment != null) {
@@ -860,7 +931,8 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+
symbol_map.set (element, node);
parent.add_child (node);
@@ -892,7 +964,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -920,7 +992,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1055,7 +1127,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1104,7 +1176,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/driver/0.18.x/treebuilder.vala b/src/driver/0.18.x/treebuilder.vala
index aa1d7cb..05e7636 100644
--- a/src/driver/0.18.x/treebuilder.vala
+++ b/src/driver/0.18.x/treebuilder.vala
@@ -356,6 +356,77 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
return element.name;
}
+ private string? get_quark_macro_name (Vala.ErrorDomain element) {
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+ }
+
+ private string? get_private_cname (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ string? cname = get_cname (element);
+ return (cname != null)? cname + "Private" : null;
+ }
+
+ private string? get_class_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_GET_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string? get_class_type_macro_name (Vala.Class element) {
+ if (element.is_compact) {
+ return null;
+ }
+
+ return "%s_CLASS".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string? get_is_type_macro_name (Vala.TypeSymbol element) {
+ string? name = Vala.CCodeBaseModule.get_ccode_type_check_function (element);
+ return (name != null && name != "")? name : null;
+ }
+
+ private string? get_is_class_type_macro_name (Vala.TypeSymbol element) {
+ string? name = get_is_type_macro_name (element);
+ return (name != null)? name + "_CLASS" : null;
+ }
+
+ private string? get_type_function_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return "%s_get_type".printf (Vala.CCodeBaseModule.get_ccode_lower_case_name (element, null));
+ }
+
+ private string? get_type_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && ((Vala.Class) element).is_compact) || element is Vala.ErrorDomain || element is Vala.Delegate) {
+ return null;
+ }
+
+ return Vala.CCodeBaseModule.get_ccode_type_id (element);
+ }
+
+ private string? get_type_cast_macro_name (Vala.TypeSymbol element) {
+ if ((element is Vala.Class && !((Vala.Class) element).is_compact) || element is Vala.Interface) {
+ return Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null);
+ } else {
+ return null;
+ }
+ }
+
+ private string? get_interface_macro_name (Vala.Interface element) {
+ return "%s_GET_INTERFACE".printf (Vala.CCodeBaseModule.get_ccode_upper_case_name (element, null));
+ }
+
+ private string get_quark_function_name (Vala.ErrorDomain element) {
+ return Vala.CCodeBaseModule.get_ccode_lower_case_prefix (element) + "quark";
+ }
+
private PackageMetaData? get_package_meta_data (Package pkg) {
foreach (PackageMetaData data in packages) {
if (data.package == pkg) {
@@ -876,7 +947,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_class == null && element.name == "string";
- Class node = new Class (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
+ Class node = new Class (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_private_cname (element), get_class_macro_name (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_class_type_macro_name (element), get_is_class_type_macro_name (element), Vala.GDBusModule.get_dbus_name (element), get_ccode_type_id (element), get_param_spec_function (element), get_ref_function (element), get_unref_function (element), get_take_value_function (element), get_get_value_function (element), get_set_value_function (element), element.is_fundamental (), element.is_abstract, is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -908,7 +979,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), Vala.GDBusModule.get_dbus_name (element), element);
+ Interface node = new Interface (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_is_type_macro_name (element), get_type_cast_macro_name (element), get_type_function_name (element), get_interface_macro_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -936,7 +1007,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
bool is_basic_type = element.base_type == null && (element.is_boolean_type () || element.is_floating_type () || element.is_integer_type ());
- Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
+ Struct node = new Struct (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), get_ccode_type_id (element), get_dup_function (element), get_free_function (element), is_basic_type, element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1071,7 +1142,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), element);
+ Symbol node = new Enum (parent, file, element.name, get_access_modifier(element), comment, get_cname (element), get_type_macro_name (element), get_type_function_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
@@ -1120,7 +1191,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
SourceFile? file = get_source_file (element);
SourceComment? comment = create_comment (element.comment);
- Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier(element), comment, get_cname(element), Vala.GDBusModule.get_dbus_name (element), element);
+ Symbol node = new ErrorDomain (parent, file, element.name, get_access_modifier (element), comment, get_cname (element), get_quark_macro_name (element), get_quark_function_name (element), Vala.GDBusModule.get_dbus_name (element), element);
symbol_map.set (element, node);
parent.add_child (node);
diff --git a/src/libvaladoc/api/class.vala b/src/libvaladoc/api/class.vala
index 071b9e4..273f249 100644
--- a/src/libvaladoc/api/class.vala
+++ b/src/libvaladoc/api/class.vala
@@ -38,14 +38,21 @@ public class Valadoc.Api.Class : TypeSymbol {
private string? param_spec_function_name;
private string? ref_function_name;
private string? type_id;
+ private string? is_class_type_macro_name;
+ private string? class_type_macro_name;
+ private string? class_macro_name;
+ private string? private_cname;
private string? cname;
-
- public Class (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, string? type_id, string? param_spec_function_name, string? ref_function_name, string? unref_function_name, string? take_value_function_cname, string? get_value_function_cname, string? set_value_function_cname, bool is_fundamental, bool is_abstract, bool is_basic_type, void* data) {
- base (parent, file, name, accessibility, comment, is_basic_type, data);
+ public Class (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? private_cname, string? class_macro_name, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, string? class_type_macro_name, string? is_class_type_macro_name, string? dbus_name, string? type_id, string? param_spec_function_name, string? ref_function_name, string? unref_function_name, string? take_value_function_cname, string? get_value_function_cname, string? set_value_function_cname, bool is_fundamental, bool is_abstract, bool is_basic_type, void* data) {
+ base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, is_basic_type, data);
this.interfaces = new ArrayList<TypeReference> ();
+ this.is_class_type_macro_name = is_class_type_macro_name;
+ this.class_type_macro_name = class_type_macro_name;
+ this.class_macro_name = class_macro_name;
+ this.private_cname = private_cname;
this.dbus_name = dbus_name;
this.type_id = type_id;
this.cname = cname;
@@ -79,6 +86,13 @@ public class Valadoc.Api.Class : TypeSymbol {
}
/**
+ * Returns the name of this class' private data structure as it is used in C.
+ */
+ public string? get_private_cname () {
+ return private_cname;
+ }
+
+ /**
* Returns the C symbol representing the runtime type id for this data type.
*/
public string? get_type_id () {
@@ -143,6 +157,27 @@ public class Valadoc.Api.Class : TypeSymbol {
}
/**
+ * Gets the name of the GType macro which returns the class struct.
+ */
+ public string get_class_macro_name () {
+ return class_macro_name;
+ }
+
+ /**
+ * Gets the name of the GType macro which returns the type of the class.
+ */
+ public string get_class_type_macro_name () {
+ return class_type_macro_name;
+ }
+
+ /**
+ * Gets the name of the GType macro which returns whether a class instance is of a given type.
+ */
+ public string get_is_class_type_macro_name () {
+ return is_class_type_macro_name;
+ }
+
+ /**
* Returns a list of all newly implemented interfaces.
*
* @see get_full_implemented_interface_list
diff --git a/src/libvaladoc/api/delegate.vala b/src/libvaladoc/api/delegate.vala
index d6b3a6c..a5f6c67 100644
--- a/src/libvaladoc/api/delegate.vala
+++ b/src/libvaladoc/api/delegate.vala
@@ -40,7 +40,7 @@ public class Valadoc.Api.Delegate : TypeSymbol, Callable {
public Delegate (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, bool is_static, void* data) {
- base (parent, file, name, accessibility, comment, false, data);
+ base (parent, file, name, accessibility, comment, null, null, null, null, false, data);
this.is_static = is_static;
this.cname = cname;
diff --git a/src/libvaladoc/api/enum.vala b/src/libvaladoc/api/enum.vala
index 423f0a7..12652f8 100644
--- a/src/libvaladoc/api/enum.vala
+++ b/src/libvaladoc/api/enum.vala
@@ -30,8 +30,8 @@ using Valadoc.Content;
public class Valadoc.Api.Enum : TypeSymbol {
private string cname;
- public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, void* data) {
- base (parent, file, name, accessibility, comment, false, data);
+ public Enum (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, void* data) {
+ base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, false, data);
this.cname = cname;
}
diff --git a/src/libvaladoc/api/errordomain.vala b/src/libvaladoc/api/errordomain.vala
index 9ec8075..4851010 100644
--- a/src/libvaladoc/api/errordomain.vala
+++ b/src/libvaladoc/api/errordomain.vala
@@ -28,12 +28,16 @@ using Valadoc.Content;
* Represents an error domain declaration.
*/
public class Valadoc.Api.ErrorDomain : TypeSymbol {
+ private string? quark_function_name;
+ private string? quark_macro_name;
private string? dbus_name;
private string? cname;
- public ErrorDomain (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, void* data) {
- base (parent, file, name, accessibility, comment, false, data);
+ public ErrorDomain (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? quark_macro_name, string? quark_function_name, string? dbus_name, void* data) {
+ base (parent, file, name, accessibility, comment, null, null, null, null, false, data);
+ this.quark_function_name = quark_function_name;
+ this.quark_macro_name = quark_macro_name;
this.dbus_name = dbus_name;
this.cname = cname;
}
@@ -53,6 +57,20 @@ public class Valadoc.Api.ErrorDomain : TypeSymbol {
}
/**
+ * Gets the name of the quark() function which represents the error domain
+ */
+ public string get_quark_function_name () {
+ return quark_function_name;
+ }
+
+ /**
+ * Gets the name of the quark macro which represents the error domain
+ */
+ public string get_quark_macro_name () {
+ return quark_macro_name;
+ }
+
+ /**
* { inheritDoc}
*/
public override NodeType node_type {
diff --git a/src/libvaladoc/api/interface.vala b/src/libvaladoc/api/interface.vala
index cf13302..2446d1b 100644
--- a/src/libvaladoc/api/interface.vala
+++ b/src/libvaladoc/api/interface.vala
@@ -29,12 +29,15 @@ using Valadoc.Content;
* Represents a interface declaration in the source code.
*/
public class Valadoc.Api.Interface : TypeSymbol {
+ private string? interface_macro_name;
private string? dbus_name;
private string? cname;
- public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? dbus_name, void* data) {
- base (parent, file, name, accessibility, comment, false, data);
+ public Interface (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, string interface_macro_name, string? dbus_name, void* data) {
+ base (parent, file, name, accessibility, comment, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, false, data);
+
+ this.interface_macro_name = interface_macro_name;
this.dbus_name = dbus_name;
this.cname = cname;
}
@@ -95,6 +98,13 @@ public class Valadoc.Api.Interface : TypeSymbol {
}
/**
+ * Gets the name of the GType macro which returns the interface struct.
+ */
+ public string get_interface_macro_name () {
+ return interface_macro_name;
+ }
+
+ /**
* A preconditioned class or null
*/
public TypeReference? base_type {
diff --git a/src/libvaladoc/api/struct.vala b/src/libvaladoc/api/struct.vala
index 3024948..475f6d8 100644
--- a/src/libvaladoc/api/struct.vala
+++ b/src/libvaladoc/api/struct.vala
@@ -33,8 +33,8 @@ public class Valadoc.Api.Struct : TypeSymbol {
private string? type_id;
private string? cname;
- public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_id, string? dup_function_cname, string? free_function_cname, bool is_basic_type, void* data) {
- base (parent, file, name, accessibility, comment, is_basic_type, data);
+ public Struct (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? cname, string? type_macro_name, string? type_function_name, string? type_id, string? dup_function_cname, string? free_function_cname, bool is_basic_type, void* data) {
+ base (parent, file, name, accessibility, comment, type_macro_name, null, null, type_function_name, is_basic_type, data);
this.dup_function_cname = dup_function_cname;
this.free_function_cname = free_function_cname;
diff --git a/src/libvaladoc/api/typesymbol.vala b/src/libvaladoc/api/typesymbol.vala
index 83b9776..e50ff15 100644
--- a/src/libvaladoc/api/typesymbol.vala
+++ b/src/libvaladoc/api/typesymbol.vala
@@ -29,10 +29,19 @@ using Gee;
*/
public abstract class Valadoc.Api.TypeSymbol : Symbol {
private SourceComment? source_comment;
+ private string? type_macro_name;
+ private string? is_type_macro_name;
+ private string? type_cast_macro_name;
+ private string? type_function_name;
- public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, bool is_basic_type, void* data) {
+ public TypeSymbol (Node parent, SourceFile file, string name, SymbolAccessibility accessibility, SourceComment? comment, string? type_macro_name, string? is_type_macro_name, string? type_cast_macro_name, string? type_function_name, bool is_basic_type, void* data) {
base (parent, file, name, accessibility, data);
+ this.type_cast_macro_name = type_cast_macro_name;
+ this.is_type_macro_name = is_type_macro_name;
+ this.type_function_name = type_function_name;
+ this.type_macro_name = type_macro_name;
+
this.is_basic_type = is_basic_type;
this.source_comment = comment;
}
@@ -46,6 +55,34 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
}
/**
+ * Gets the name of the GType macro which represents the type symbol
+ */
+ public string get_type_macro_name () {
+ return type_macro_name;
+ }
+
+ /**
+ * Gets the name of the GType macro which casts a type instance to the given type.
+ */
+ public string get_type_cast_macro_name () {
+ return type_cast_macro_name;
+ }
+
+ /**
+ * Gets the name of the GType macro which determines whether a type instance is of a given type.
+ */
+ public string get_is_type_macro_name () {
+ return is_type_macro_name;
+ }
+
+ /**
+ * Gets the name of the get_type() function which represents the type symbol
+ */
+ public string get_type_function_name () {
+ return type_function_name;
+ }
+
+ /**
* { inheritDoc}
*/
internal override void process_comments (Settings settings, DocumentationParser parser) {
diff --git a/tests/generic-api-test.vala b/tests/drivers/generic-api-test.vala
similarity index 95%
rename from tests/generic-api-test.vala
rename to tests/drivers/generic-api-test.vala
index 7d04d64..02623c5 100644
--- a/tests/generic-api-test.vala
+++ b/tests/drivers/generic-api-test.vala
@@ -36,7 +36,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac
assert (en.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (en.get_full_name () == "TestEnumGlobal");
- assert (en.get_filename () == "api-test.vapi");
+ assert (en.get_filename () == "api-test.data.vapi");
assert (en.name == "TestEnumGlobal");
assert (en.nspace == global_ns);
assert (en.package == pkg);
@@ -64,7 +64,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac
assert (enval.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (enval.get_full_name () == "TestEnumGlobal.ENVAL1");
- assert (enval.get_filename () == "api-test.vapi");
+ assert (enval.get_filename () == "api-test.data.vapi");
assert (enval.nspace == global_ns);
assert (enval.package == pkg);
@@ -81,7 +81,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac
assert (enval.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (enval.get_full_name () == "TestEnumGlobal.ENVAL2");
- assert (enval.get_filename () == "api-test.vapi");
+ assert (enval.get_filename () == "api-test.data.vapi");
assert (enval.nspace == global_ns);
assert (enval.package == pkg);
@@ -122,7 +122,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestEnumGlobal.method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -153,7 +153,7 @@ public static void test_enum_global (Api.Enum? en, Api.Package pkg, Api.Namespac
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestEnumGlobal.static_method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "static_method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -197,7 +197,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg
assert (err.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (err.get_full_name () == "TestErrDomGlobal");
- assert (err.get_filename () == "api-test.vapi");
+ assert (err.get_filename () == "api-test.data.vapi");
assert (err.name == "TestErrDomGlobal");
assert (err.nspace == global_ns);
assert (err.package == pkg);
@@ -223,7 +223,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg
assert (errc.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (errc.get_full_name () == "TestErrDomGlobal.ERROR1");
- assert (errc.get_filename () == "api-test.vapi");
+ assert (errc.get_filename () == "api-test.data.vapi");
assert (errc.nspace == global_ns);
assert (errc.package == pkg);
@@ -238,7 +238,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg
assert (errc.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (errc.get_full_name () == "TestErrDomGlobal.ERROR2");
- assert (errc.get_filename () == "api-test.vapi");
+ assert (errc.get_filename () == "api-test.data.vapi");
assert (errc.nspace == global_ns);
assert (errc.package == pkg);
@@ -279,7 +279,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestErrDomGlobal.method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -310,7 +310,7 @@ public static void test_erroromain_global (Api.ErrorDomain? err, Api.Package pkg
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestErrDomGlobal.static_method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "static_method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -365,7 +365,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property3");
assert (cl.get_full_name () == "TestClassGlobal");
- assert (cl.get_filename () == "api-test.vapi");
+ assert (cl.get_filename () == "api-test.data.vapi");
assert (cl.name == "TestClassGlobal");
assert (cl.nspace == global_ns);
assert (cl.package == pkg);
@@ -395,7 +395,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestClassGlobal.method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -426,7 +426,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestClassGlobal.static_method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "static_method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -461,7 +461,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestClassGlobal.TestClassGlobal");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -487,7 +487,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestClassGlobal.TestClassGlobal.named");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -529,7 +529,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestClassGlobal.property1");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -544,7 +544,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property2");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -559,7 +559,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.setter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property2");
- assert (property.setter.get_filename () == "api-test.vapi");
+ assert (property.setter.get_filename () == "api-test.data.vapi");
assert (property.setter.nspace == global_ns);
assert (property.setter.package == pkg);
@@ -581,7 +581,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestClassGlobal.property2");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -595,7 +595,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property2");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -618,7 +618,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestClassGlobal.property3");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -632,7 +632,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property3");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -647,7 +647,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (property.setter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property3");
- assert (property.setter.get_filename () == "api-test.vapi");
+ assert (property.setter.get_filename () == "api-test.data.vapi");
assert (property.setter.nspace == global_ns);
assert (property.setter.package == pkg);
@@ -679,7 +679,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (del.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property3");
- assert (del.get_filename () == "api-test.vapi");
+ assert (del.get_filename () == "api-test.data.vapi");
assert (del.nspace == global_ns);
assert (del.package == pkg);
@@ -701,7 +701,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (sig.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (sig.get_full_name () == "TestClassGlobal.property3");
- assert (sig.get_filename () == "api-test.vapi");
+ assert (sig.get_filename () == "api-test.data.vapi");
assert (sig.nspace == global_ns);
assert (sig.package == pkg);
@@ -719,7 +719,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (constant.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (constant.get_full_name () == "TestClassGlobal.constant");
- assert (constant.get_filename () == "api-test.vapi");
+ assert (constant.get_filename () == "api-test.data.vapi");
assert (constant.name == "constant");
assert (constant.nspace == global_ns);
assert (constant.package == pkg);
@@ -744,7 +744,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (field.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (field.get_full_name () == "TestClassGlobal.field1");
- assert (field.get_filename () == "api-test.vapi");
+ assert (field.get_filename () == "api-test.data.vapi");
assert (field.nspace == global_ns);
assert (field.package == pkg);
@@ -761,7 +761,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (field.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (field.get_full_name () == "TestClassGlobal.field2");
- assert (field.get_filename () == "api-test.vapi");
+ assert (field.get_filename () == "api-test.data.vapi");
assert (field.nspace == global_ns);
assert (field.package == pkg);
@@ -789,7 +789,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (subcl.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (subcl.get_full_name () == "TestClassGlobal.InnerClass");
- assert (subcl.get_filename () == "api-test.vapi");
+ assert (subcl.get_filename () == "api-test.data.vapi");
assert (subcl.nspace == global_ns);
assert (subcl.package == pkg);
@@ -811,7 +811,7 @@ public static void test_class_global (Api.Class? cl, Api.Package pkg, Api.Namesp
assert (substru.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (substru.get_full_name () == "TestClassGlobal.InnerStruct");
- assert (substru.get_filename () == "api-test.vapi");
+ assert (substru.get_filename () == "api-test.data.vapi");
assert (substru.name == "InnerStruct");
assert (substru.nspace == global_ns);
assert (substru.package == pkg);
@@ -849,7 +849,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (iface.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (iface.get_full_name () == "TestInterfaceGlobal");
- assert (iface.get_filename () == "api-test.vapi");
+ assert (iface.get_filename () == "api-test.data.vapi");
assert (iface.name == "TestInterfaceGlobal");
assert (iface.nspace == global_ns);
assert (iface.package == pkg);
@@ -879,7 +879,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestInterfaceGlobal.method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -910,7 +910,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestInterfaceGlobal.static_method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "static_method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -941,7 +941,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestInterfaceGlobal.property1");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -956,7 +956,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestInterfaceGlobal.property2");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -971,7 +971,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.setter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestInterfaceGlobal.property2");
- assert (property.setter.get_filename () == "api-test.vapi");
+ assert (property.setter.get_filename () == "api-test.data.vapi");
assert (property.setter.nspace == global_ns);
assert (property.setter.package == pkg);
@@ -993,7 +993,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestInterfaceGlobal.property2");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -1007,7 +1007,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestInterfaceGlobal.property2");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -1030,7 +1030,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (property.get_full_name () == "TestInterfaceGlobal.property3");
- assert (property.get_filename () == "api-test.vapi");
+ assert (property.get_filename () == "api-test.data.vapi");
assert (property.nspace == global_ns);
assert (property.package == pkg);
@@ -1044,7 +1044,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.getter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestInterfaceGlobal.property3");
- assert (property.getter.get_filename () == "api-test.vapi");
+ assert (property.getter.get_filename () == "api-test.data.vapi");
assert (property.getter.nspace == global_ns);
assert (property.getter.package == pkg);
@@ -1059,7 +1059,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (property.setter.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (property.getter.get_full_name () == "TestInterfaceGlobal.property3");
- assert (property.setter.get_filename () == "api-test.vapi");
+ assert (property.setter.get_filename () == "api-test.data.vapi");
assert (property.setter.nspace == global_ns);
assert (property.setter.package == pkg);
@@ -1092,7 +1092,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (del.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (del.get_full_name () == "TestClassGlobal.property3");
- assert (del.get_filename () == "api-test.vapi");
+ assert (del.get_filename () == "api-test.data.vapi");
assert (del.nspace == global_ns);
assert (del.package == pkg);
@@ -1114,7 +1114,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (sig.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
//assert (sig.get_full_name () == "TestClassGlobal.property3");
- assert (sig.get_filename () == "api-test.vapi");
+ assert (sig.get_filename () == "api-test.data.vapi");
assert (sig.nspace == global_ns);
assert (sig.package == pkg);
@@ -1132,7 +1132,7 @@ public static void test_interface_global (Api.Interface? iface, Api.Package pkg,
assert (constant.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (constant.get_full_name () == "TestInterfaceGlobal.constant");
- assert (constant.get_filename () == "api-test.vapi");
+ assert (constant.get_filename () == "api-test.data.vapi");
assert (constant.name == "constant");
assert (constant.nspace == global_ns);
assert (constant.package == pkg);
@@ -1173,7 +1173,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
// (.Node)
//assert (property.getter.get_full_name () == "TestClassGlobal.property3");
assert (stru.get_full_name () == "TestStructGlobal");
- assert (stru.get_filename () == "api-test.vapi");
+ assert (stru.get_filename () == "api-test.data.vapi");
assert (stru.name == "TestStructGlobal");
assert (stru.nspace == global_ns);
assert (stru.package == pkg);
@@ -1203,7 +1203,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestStructGlobal.method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -1234,7 +1234,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestStructGlobal.static_method");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "static_method");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -1269,7 +1269,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestStructGlobal.TestStructGlobal");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -1295,7 +1295,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "TestStructGlobal.TestStructGlobal.named");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -1324,7 +1324,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (constant.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (constant.get_full_name () == "TestStructGlobal.constant");
- assert (constant.get_filename () == "api-test.vapi");
+ assert (constant.get_filename () == "api-test.data.vapi");
assert (constant.name == "constant");
assert (constant.nspace == global_ns);
assert (constant.package == pkg);
@@ -1350,7 +1350,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (field.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (field.get_full_name () == "TestStructGlobal.field1");
- assert (field.get_filename () == "api-test.vapi");
+ assert (field.get_filename () == "api-test.data.vapi");
assert (field.nspace == global_ns);
assert (field.package == pkg);
@@ -1367,7 +1367,7 @@ public static void test_struct_global (Api.Struct? stru, Api.Package pkg, Api.Na
assert (field.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (field.get_full_name () == "TestStructGlobal.field2");
- assert (field.get_filename () == "api-test.vapi");
+ assert (field.get_filename () == "api-test.data.vapi");
assert (field.nspace == global_ns);
assert (field.package == pkg);
@@ -1480,7 +1480,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_2.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1516,7 +1516,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_3.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1552,7 +1552,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_4.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1588,7 +1588,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_5.o");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "o");
@@ -1624,7 +1624,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_6.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1660,7 +1660,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == null);
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == null);
@@ -1687,7 +1687,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_8.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1723,7 +1723,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1755,7 +1755,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.b");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "b");
@@ -1787,7 +1787,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.c");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "c");
@@ -1819,7 +1819,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.d");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "d");
@@ -1851,7 +1851,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.e");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "e");
@@ -1883,7 +1883,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_9.f");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "f");
@@ -1915,7 +1915,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == null);
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == null);
@@ -1942,7 +1942,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_10.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -1980,7 +1980,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_11.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -2019,7 +2019,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_12.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -2058,7 +2058,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_13.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -2097,7 +2097,7 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
assert (param.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (param.get_full_name () == "ParamTest.test_function_param_14.a");
- assert (param.get_filename () == "api-test.vapi");
+ assert (param.get_filename () == "api-test.data.vapi");
assert (param.nspace == ns);
assert (param.package == pkg);
assert (param.name == "a");
@@ -2397,7 +2397,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) {
assert (method.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (method.get_full_name () == "test_function_global");
- assert (method.get_filename () == "api-test.vapi");
+ assert (method.get_filename () == "api-test.data.vapi");
assert (method.name == "test_function_global");
assert (method.nspace == global_ns);
assert (method.package == pkg);
@@ -2419,7 +2419,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) {
assert (del.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (del.get_full_name () == "test_delegate_global");
- assert (del.get_filename () == "api-test.vapi");
+ assert (del.get_filename () == "api-test.data.vapi");
assert (del.name == "test_delegate_global");
assert (del.nspace == global_ns);
assert (del.package == pkg);
@@ -2440,7 +2440,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) {
assert (field.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (field.get_full_name () == "test_field_global");
- assert (field.get_filename () == "api-test.vapi");
+ assert (field.get_filename () == "api-test.data.vapi");
assert (field.name == "test_field_global");
assert (field.nspace == global_ns);
assert (field.package == pkg);
@@ -2459,7 +2459,7 @@ public static void test_global_ns (Api.Namespace global_ns, Api.Package pkg) {
assert (constant.accessibility == Api.SymbolAccessibility.PUBLIC);
// (.Node)
assert (constant.get_full_name () == "test_const_global");
- assert (constant.get_filename () == "api-test.vapi");
+ assert (constant.get_filename () == "api-test.data.vapi");
assert (constant.name == "test_const_global");
assert (constant.nspace == global_ns);
assert (constant.package == pkg);
@@ -2575,7 +2575,7 @@ public static void test_driver (string driver_path) {
var reporter = new ErrorReporter ();
settings.source_files = {
- "../../tests/drivers/api-test.vapi"
+ "../../tests/drivers/api-test.data.vapi"
};
settings._protected = false;
diff --git a/tests/helpers.vala b/tests/libvaladoc/parser/generic-scanner.vala
similarity index 100%
rename from tests/helpers.vala
rename to tests/libvaladoc/parser/generic-scanner.vala
diff --git a/tests/testrunner.sh b/tests/testrunner.sh
index cf83ec1..a116c61 100755
--- a/tests/testrunner.sh
+++ b/tests/testrunner.sh
@@ -30,7 +30,7 @@ export G_DEBUG=fatal_warnings
export PKG_CONFIG_PATH=../../src/libvaladoc
VALAC=valac
-VALAFLAGS="--vapidir ../../src/libvaladoc --pkg valadoc-1.0 --pkg gee-1.0 --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -L../../src/libvaladoc/.libs -X -I../../src/libvaladoc ../helpers.vala ../generic-api-test.vala"
+VALAFLAGS="--vapidir ../../src/libvaladoc --pkg valadoc-1.0 --pkg gee-1.0 --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -L../../src/libvaladoc/.libs -X -I../../src/libvaladoc ../libvaladoc/parser/generic-scanner.vala ../drivers/generic-api-test.vala"
VAPIGEN=$topbuilddir/vapigen/vapigen
VAPIGENFLAGS=
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]